Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 30th, 2012  |  syntax: None  |  size: 0.46 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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.     }