I am trying to validate a Select field in using HTML5; it’s working perfectly fine in Chrome and FF browser, but when I tried in IE and Safari, it’s not working. I tried using a JavaScript to get it to work, but I’m still having the same problem. Please help me out. The sample of my code is here:
How can I fix it so the same code works with all four browsers?
Instead of an
onclickon the submit button, it’s better to have this:Edit: The
validate(this)will call thevalidatefunction and pass itself (the form) asf. Then, the fields within the form can be refered to by name (e.g.emptyandselect_box)Hope this helps 🙂