[thelist] Javascript: problem writing parsed URL variable to form text box

Robert Vreeland vreeland at studioframework.com
Tue Oct 4 21:21:58 CDT 2005


For what it is worth, my experience is that JavaScript, especially in IE, is
quirky when setting an element attribute that has not been previously
defined in the HTML code. So to be on the safe side, I would add the
attribute 'value=""' as shown below.

<input type="text" name="uP_fname" id="uP_fname" value="" />

Robert Vreeland

-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Brian Cummiskey
Sent: Tuesday, October 04, 2005 7:27 PM
To: thelist at lists.evolt.org
Subject: Re: [thelist] Javascript: problem writing parsed URL variable to
form text box

Bruso, John wrote:
> I have this login form that I want to be able to feed a variable to 
> via the URL.
> 
>  For example:
> http://dev.sheridan.edu/uportal/login/index.htm?uP_fname=eservices-out
> lo
> ok >
> 
>  So far I've managed to parse the URL and even write the variable to  
> the page, but I'm pulling my hair out trying to figure out how to  
> write that variable inside of a text box.

if you have the var, its as simple as writing the following:


document.getElementById("uP_fname").value = your_var_here;



and your form should look like:

<input type="text" name="uP_fname" id="uP_fname" />


and call it in the onload method like you're doing.
-- 

* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester and archives
of thelist go to: http://lists.evolt.org Workers of the Web, evolt ! 



More information about the thelist mailing list