An input is filed after clicking on the "submit" button, it is empty, it will show an essential message like "This field is required". After touching the input, and after typing anything, the required message should be terminated when typing anything on the input field, this input field is not empty. But, I can not hide that message instantly when typing. It has been hidden after clicking on the submit button again but, I have to hide immediately when it has been filed and is no longer empty. how to do this? I've used it:
if ($ ('# field'). Val () == '') {$ ('. Required') Show (); } And {$ ('. Required'). Hide (); }
update
Code> $ ('body'). ('Click', 'button', submit form); . $ ('# Field') KeyUp (isFormValid); Function isFormValid () {if ($ ('$'). Val () == '') {$ ('. Required') Show (); return false; } And {$ ('. Required'). Hide (); Back true; }} Submit form of form () {if (isFormValid ()) {Warning ('form is valid'); } And {warnings ('form is not valid'); }}
UPDATED
You have to do the same and then click on the click that you are making on click.
Something like this
$ ('body'). ('Click', 'button', form check); . $ ('# Field') KeyUp (formCheck); Function form check () {if ($ ('$'). Val () == '') {$ ('. Required') Show (); } And {$ ('. Required'). Hide (); }}
here is a
No comments:
Post a Comment