View Full Version : JavaScript
Does anyone know if it's possible to have JavaScript read from the query string (and how)? I've poked thru my JS bookmarks, and not found anything so far (still lookin tho). I don't need it to parse it at all, as the string will only be one word. I just need it to recognize what word it is, and auto-select a form element accordingly.
Thanks in advance
------------------
Del
www.downinit.com (http://www.downinit.com)
da da da
Justin
01-09-1999, 04:47 PM
I don't think there's a way, but I don't know for sure. I would like to be able to do that too, and I did some research on that myself, turning up nothing.
In order for that to work, you'd have to be able to take a command line arguement, the string, and I don't think that's possible. I'm sure that there's a script or a way to do what you need to do with perl or php3.
What exactly do you need to do with this string? If it's something like selecting a form option according to what page they came from, or some other parameter, you might be able to use SSI or something.
Justin, rambling away again...
The theory was to have one 'contact' page for the whole domain, which could be called via contact.html?blah. The subject field would be a select box, so the user could choose what section of the site the email was related to (cgi, cars, r/c cars, other). I wanted to use the JS to auto select which option depending on the query string. Didn't really want to use Perl, mostly because there's no point in spawning a process just to print a mail form.
I've since kinda given up on using JS anyway as I've found another problem http://www.aota.net/ubb/smile.gif My JS knowledge isn't good enough to figure out how to 'dynamicly' select an option in a select box (whether it came from a query string or otherwise). It's also not a high priority, so I'm not too concerned about it.
Thanks anyway tho http://www.aota.net/ubb/smile.gif I probably will end up using Perl to do it someday.
------------------
Del
www.downinit.com (http://www.downinit.com)
da da da
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.