We want to display a div when the validation is passed for that field. We verify the validation direct after hitting the next field,

For example when a customer enters their first name, we want to display a div that says "Hi (customers-firstname)"

What code do we need to display a div when validation is passed?



One thing you can do is to set a display:none attribute to you division. And, in the javascript do something like this using jQuery:

if(this.validator.validate()){ //or however you're validating your form

Or, if for whatever reason you don't want to add the new division on the new page at all you can also use jQuery to input html code into the page itself, so, something like:

    var division_new = '<div>Hi there </div>';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.