
Untitled
By: a guest on
May 30th, 2012 | syntax:
None | size: 0.46 KB | hits: 10 | expires: Never
html5 input type required without a form. Does it work?
<input type='text' required>
<input id='name' type='text' required>
<input id='surname' type='text' required>
<input id='send' type='button' onclick ='send()'>
function send() {
if (document.getElementById('name').value == '') { alert('missing name'); return }
if (document.getElementById('surname').value == '') { alert('missing surname'); return }
// logic now...
}