oo7ml
Oct 19th 2007, 2:19 pm
Hi have some form validation on a small page i have. It checks that the fields A, B, C & D are are not empty. However i want to have validation on the D field to make sure that only the values 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 are allowed only and not 11, 12... or not 01, 02... - only the scores 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Here is the code i have now:
<input type="image" src="../images/accept.jpg" onMouseOut=this.src='../images/accept.jpg' onMouseOver=this.src='../images/accept_o.jpg' onClick="if(document.getElementById('A').value == '' || document.getElementById('B').value == '' || document.getElementById('C').value == '' || document.getElementById('D').value == '') { alert('Ooops... Please fill in A, B, C, D'); return false;}" />
Can someone please add on the code needed for this please as i need to fix it urgently, thanks for your help
Here is the code i have now:
<input type="image" src="../images/accept.jpg" onMouseOut=this.src='../images/accept.jpg' onMouseOver=this.src='../images/accept_o.jpg' onClick="if(document.getElementById('A').value == '' || document.getElementById('B').value == '' || document.getElementById('C').value == '' || document.getElementById('D').value == '') { alert('Ooops... Please fill in A, B, C, D'); return false;}" />
Can someone please add on the code needed for this please as i need to fix it urgently, thanks for your help