Posted By

scriptmakingcom on 09/13/07


Tagged

form alert contents


Versions (?)

Alert entire contents of form


 / Published in: JavaScript
 

  1. function showVals() {
  2. theForm = document.getElementById('myform');
  3. theStr = '';
  4. for (i=0; i < theForm.elements.length; i++) {
  5. ele = theForm.elements[i];
  6. theStr += ele.name + ' : ' + ele.value + "\n";
  7. }
  8. alert (theStr);
  9. }

Report this snippet  

You need to login to post a comment.