[thelist] Javascript: url variable to form text field

Tom Dell'Aringa pixelmech at yahoo.com
Thu Mar 13 14:10:22 CST 2003


--- michael grover <mike at michaelgrover.com> wrote:

:: Sorry if this double posted ::

> 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.

My Bad, Michael, not paying close enough attention. The below works,
just replace my global variable with your URL vars. You need to write
out the whole input tag:

-----
<html>
<head>
	<title>Untitled</title>
<script>
var foo = "fooey!";
</script>
</head>

<body>

<form name="test">

<script>
document.write("The Value: <input type=\"test\" name=\"textbox\"
value='"+foo+"' />");
</script>

</form>


</body>
</html>
-------------

HTH

Tom

=====
>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
http://www.pixelmech.com/
var me = tom.pixelmech.webDeveloper();

http://www.maccaws.com/
[Making A Commercial Case for Adopting Web Standards]

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com


More information about the thelist mailing list