Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

html value set from javascript?

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

like image 518
T.T.T. Avatar asked Mar 02 '09 20:03

T.T.T.


2 Answers

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

<script type="text/javascript">
    document.getElementById("Text1").value = p;
</script>
like image 200
Rudd Zwolinski Avatar answered Sep 22 '22 10:09

Rudd Zwolinski


document.getElementById('Text1').value = p;
like image 36
nduplessis Avatar answered Sep 20 '22 10:09

nduplessis