I have written the following function, which checks whether the start_date field is not empty and shows the appropriate message when the button is pressed . But then this control takes you to the previous page. The user must rewrite all other fields on that form. Is there any way to stay on that page even after encouraging error messages with all other field values?
// JavaScript function checkform () (if (document.frmMr.start_date.value == "") {Warning ("Please enter start_date"); Details are false;} and { Document.frmMr.submit ();}} // HTML & lt; html & gt; form name = frmMr action = "page1.jsp" & gt; Enter start date: & lt; input type = " Text "size =" 15 "name =" start_date "id =" start_date ">
you have a writer The value is the checkform, it is not being used anywhere - instead of trying to use " onclick =" return checkform () "
instead you On changing the form, you can consider with onsubmit = "return checkform ()" , although both will work to click on the button.
Comments
Post a Comment