0

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?

Thanks!

0

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
    jQuery('your-division').show();
}

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:

if(this.validator.validate()){
    var division_new = '<div>Hi there </div>';
    jQuery('parent_div').html(division_new);
}

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.