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:

PIXO Support (1997) Sending Faxes (2003) nesting limits? (1998) Any way to retrieve information from clipboard? (1999) question on [delete] (1998) RE: path hierarchy notation (1998) Browser based content... (2004) TaxTotal Problem (1997) WebMerchant 1.6 and https (1997) WebCat Ad! (2000) Secure Server basic question... (1997) Security (1998) Simple way to create unique SKU (1997) UPDATE PROBLEM (1997) Bug Report, maybe (1997) Add a field to the error log? (1997) This list needs a digest: rant, rave... (1997) Location of Browser Info.txt file (1997) FW: WebDNA-Talk searchable? (1997) Having trouble installing on Windows XP Pro... (2006)