I need to show the error message based on input error. what I’m doing wrong?
also the error should be displayed when the h5validation adds the class .ui-state-error
if ($(“.ui-state-error”).is(“:visible”) == true) { find errors and display input:email
<section class="errors">
<p class="email"><span>Please enter a valid Email.</span></p>
<p class="password"><span>Please re-type your password.</span> Your passwords didn't match.</p>
<p class="repeat-password"><span>Please re-type your password.</span> Your passwords didn't match.</p>
</section>
The first thing you need to take a look at is how you call the .live() method.
.live()does not take a function as the first parameter, it takes the event you want it to listen for as the first parameter and the function as the second paramter, so that will likely cause you some trouble. Also, since jQuery 1.7,.live()is deprecated in favor of.on().If you want the function to be called on submit, which is probably the most common, then you should use
.submit()instead of.live().