Posted By

assbach on 02/03/07


Tagged

javascript js forms autofill


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

vali29


autofill and select formfields for debugging


 / Published in: JavaScript
 

when testing forms you don't always want to fill in dummydate this is a function i used to autofill and select values.

  1. function dummyreg() {
  2. var currentTime = Date.parse(new Date());
  3.  
  4. document.getElementById("nickname").value = "dummynick" + currentTime;
  5. document.getElementById("checkbox").checked = true; // checkbox
  6. document.getElementById("radiobutton").checked = true; // radiobutton
  7. document.getElementById("pulldown").selectedIndex = 2; // dropdown
  8.  
  9. }

Report this snippet  

You need to login to post a comment.