Re: Passing form variables to new window created by JavaScript

This WebDNA talk-list message is from

2001


It keeps the original formatting.
numero = 37361
interpreted = N
texte = on 24/7/01 8:54 AM, Steven Jarvis at sjarvis@nwaonline.net wrote:> MacOS 9.1, WebSTAR 4.4, WebCat 4.0.2rc1 patched > > > First off, I suck at JavaScript. It's on the list of things to learn more > about. > > That being said, I have a part of a site that shows local movie listings. > Users can search by theater or by movie. They select a movie or a theater > from a selection list and click on the submit button. If I just have it go > another page in the same window, it works just fine --- the the variables > get passed. > > BUT, if I try to do it via a new window created via a JavaScript function, > the formvariables are NOT passed to the new window where they are needed for > a search. > > Is there a way to pass select option values to a new window created with > JavaScript? I searched the archives, but I couldn't find anything exactly on > point or that I understood enough to modify to my needs. > > > Below is the code for one of the forms: > > > > > >
action=javascript:newWindow('movies/movies_showmovie.tpl');> > [search db=admin/listing.db&eqFIELD1datarq=4&asFIELD3sort=1] > > [/search] > > >
> > I'd just put the variable in the URL I'm passing to the JS function, but it > depends on the selected option. I can't figure out how to get the value of > the selected option and insert it into a JS function. > > > Any help would be greatly appreciated. > > Thanks, > > Steven > > > -- > Steven Jarvis > Web Developer > sjarvis@nwaonline.net > NWAonline.net > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > > Web Archive of this list is at: http://search.smithmicro.com/Reference the option select within the document object and give the form a name or id..document.formname.optionname[selectedindex].valueyou may need to reference the form via the elements collection for this to work multi browser...document.elements[0].optionname[selectindex].valueThis should work I think.dont take my word for it - check it out at:http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/ref erence/dhtmlrefs.asplook up the input objects under DHTML Objects. ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Passing form variables to new window created by JavaScript (Andrew Simpson 2001)
  2. Passing form variables to new window created by JavaScript (Steven Jarvis 2001)
on 24/7/01 8:54 AM, Steven Jarvis at sjarvis@nwaonline.net wrote:> MacOS 9.1, WebSTAR 4.4, WebCat 4.0.2rc1 patched > > > First off, I suck at JavaScript. It's on the list of things to learn more > about. > > That being said, I have a part of a site that shows local movie listings. > Users can search by theater or by movie. They select a movie or a theater > from a selection list and click on the submit button. If I just have it go > another page in the same window, it works just fine --- the the variables > get passed. > > BUT, if I try to do it via a new window created via a JavaScript function, > the formvariables are NOT passed to the new window where they are needed for > a search. > > Is there a way to pass select option values to a new window created with > JavaScript? I searched the archives, but I couldn't find anything exactly on > point or that I understood enough to modify to my needs. > > > Below is the code for one of the forms: > > > > > >
action=javascript:newWindow('movies/movies_showmovie.tpl');> > [search db=admin/listing.db&eqFIELD1datarq=4&asFIELD3sort=1] > > [/search] > > >
> > I'd just put the variable in the URL I'm passing to the JS function, but it > depends on the selected option. I can't figure out how to get the value of > the selected option and insert it into a JS function. > > > Any help would be greatly appreciated. > > Thanks, > > Steven > > > -- > Steven Jarvis > Web Developer > sjarvis@nwaonline.net > NWAonline.net > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > > Web Archive of this list is at: http://search.smithmicro.com/Reference the option select within the document object and give the form a name or id..document.formname.optionname[selectedindex].valueyou may need to reference the form via the elements collection for this to work multi browser...document.elements[0].optionname[selectindex].valueThis should work I think.dont take my word for it - check it out at:http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/ref erence/dhtmlrefs.asplook up the input objects under DHTML Objects. ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Andrew Simpson

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Drop Down Menu from comma delimited values. (2002) Protect tag for large groups? (1999) Setting user/password with a form. (2000) Number searching/formats (1998) Feature req. (2002) WebCat2: Items xx to xx shown, etc. (1997) [WebDNA] special chars (2009) So Simple (2005) [WebDNA] I'm stuck... :-( (2009) searching by date (1998) Multiple Pulldowns (1997) Calendar Program (2004) RE: Help name our technology! (1997) OS X permissions to write to Globals directory (2003) When do we get to request new features? (1999) Search returns all, not 20 (1997) UPS Quick Cost Calculator (1997) [OT] CSS div/span (2004) [WebDNA] HTTP crashes (2010) Emailer choke (1997)