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:

MacWEEK article help needed (1996) Another issue with [Date format] (1998) Follow-Up to: Removing [showif] makes a big difference in speed (1997) Summ=T Problem (1997) WebCat2b13MacPlugin - nested [xxx] contexts (1997) Browser Problem?!? Still getting Error message using POST! (1997) URL for Discussion Archive (1997) Apache on windows and WebDNA (2004) Browser Problem?!? Still getting Error message using POST! (1997) Dealing with da back button (1999) 2.0 Info (1997) Search design (1997) Customizing WebDelivery.html (1998) [Webcat 2]Next (1997) [ShowNext] (1997) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) How true is this? (1999) best way to get 2 unique strings on the same page load? (2000) WebCatalog for Postcards ? (1997) WC 2.0 frames feature (1997)