[thelist] Javascript: url variable to form text field

michael grover mike at michaelgrover.com
Thu Mar 13 13:46:37 CST 2003


When I asked:

> I want to use Javascript to grab one particular variable out of a
> url sting containing many variables and I want to populate that
> variable into the text box of a form on the page.

Tom and Joshua helped me by saying....

> ><input type="text" value="
> > <script>
> > url["foo"]
> > </script>
> > " /> 

and
 
> <input type="text" value="
> <script language="JavaScript" type="text/javascript">
> document.write(url["foo"]);
> </script>
> " />

I tried both those examples and found that the text box terminates at 
the end of  of the <script language="JavaScript" type="text/javascript"> 
 I also tried encapsulating the entire form with <script 
language="JavaScript"></javascript> but then the entire form dissappeared.

Mike.





More information about the thelist mailing list