Sunday, 15 April 2012

javascript - checking text visibility with jquery .contains code not behaving as expected -


I have a form that dynamically displays an error message "This is a necessary question" whenever anyone The required field is left blank, the submit button has been clicked. I have to see that the error message is appearing on the webpage. If so, then I should display a warning box with the message, "Errors in the form were found, please correct them"! If not, then I can go ahead and process the form. I am using jquery for this problem here: I filled out the form without any error and when I click on submit button it still pops up the warning box. Is my code correct?

accepting a string Do you have to pass it in quotes.

then use,

  $ ('div: in' (this is a required question) ")  

Full code

  if ($ ('div' is included ("this is a required question")). (': Visible')) {Warning ( 'Errors in the form, please correct them!'); } And {google.script.run.withSuccessHandler (success) .withFailureHandler (unsuccessful) .processForm (); }  

No comments:

Post a Comment