I'd like a very simple visual form validation. The only thing i need is that i'd like an image (checkmark) to appear next to a form field (textfield, textarea, dropdown, radio, checkbox) whenever a field is filled in correctly. In general this means:
- A radiogroup should be selected
- A textarea and textfield should have two or more characters in it.
- A dropdown should have a selected value (not empty).
The real validation happens in PHP, but i just want to show the visitor little checkmarks when a field is filled in. The checkmark should be removed whenever a field is cleared again or something like that.
var myTextField = document.getElementById(id);
if(myTextField.value != "") myTextField.style.display = "";
else myTextField.style.display = "none";