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

Peter Brunone (EasyListBox.com) peter at easylistbox.com
Tue Oct 4 22:44:59 CDT 2005


	I'm curious; when have you seen that happen, and what was the
behavior?  I can't think of anything, learned or experienced, between IE
2 and IE 6, that would indicate this would be a problem.

Cheers,

Peter

-----Original Message-----
From: thelist-bounces at lists.evolt.org On Behalf Of Robert Vreeland

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 On Behalf Of Brian Cummiskey

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.





More information about the thelist mailing list