views:

1129

answers:

3
<script type="text/javascript">
  var p = s.getMaximum();
</script>

<form action="/cgi-bin/Lib.exe" method="POST" name="checks" ID="Form1">
    <INPUT TYPE="text" NAME="inputbox" VALUE="VAR P FROM JAVA SCRIPT HERE?" ID="Text1"><P></form>

Possible to pass the javascript value 'p' as the value of input form?

Thanks.

+5  A: 

You can use javascript to set the value of that element to p.

<script type="text/javascript">
    document.getElementById("Text1").value = p;
</script>
Rudd Zwolinski
+2  A: 
document.getElementById('Text1').value = p;
nduplessis
+2  A: 

You want to read about the Javascript DOM.

Start with the following: http://www.w3schools.com/htmldom/dom_obj_form.asp

Specifically you're looking to manipulate document.checks.inputbox.value

Frakkle
this works, makes sense. Thanks.
Tommy