john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

javascript onclick onsubmit

javascript-onclick-onsubmit



<html>
<body>

Field1: <input type="text" id="field1" value="Hello World!">
<br />
Field2: <input type="text" id="field2">
<br /><br />
Click the button below to copy the content of Field1 to Field2.
<br />
<button onclick="document.getElementById('field2').value=
document.getElementById('field1').value">Copy Text</button>

</body>
</html>





<FORM ACTION="javascript-form-validation.htm" NAME="testform" onSubmit="return validateMyForm()">

</form>

<script type="text/javascript" language="javascript">
  function validateMyForm()
  {
    var tempvalue = document.getElementById( 'userinput' ).value;
    alert( tempvalue );
  }
</script>

  • « javascript servlet form textbox focus
  • javascript servlet form textbox validation »

Published

Jul 27, 2011

Category

java-servlet

~57 words

Tags

  • java-servlet 61
  • javascript 43
  • onclick 2
  • onsubmit 1