Guest User

Untitled

a guest
May 30th, 2012
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. html5 input type required without a form. Does it work?
  2. <input type='text' required>
  3.  
  4. <input id='name' type='text' required>
  5. <input id='surname' type='text' required>
  6. <input id='send' type='button' onclick ='send()'>
  7.  
  8. function send() {
  9. if (document.getElementById('name').value == '') { alert('missing name'); return }
  10. if (document.getElementById('surname').value == '') { alert('missing surname'); return }
  11.  
  12. // logic now...
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment