view.contact.js custom error

Home Forums Porto – Responsive HTML5 Template view.contact.js custom error

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10005315
    marc_berman14
    Participant

    Hi there

    I need a bit of assistance.

    I am creating a PHP form based off the basic contact form provided in the template. I have added an extra field and everything is perfect. My issue is I need to report back specific errors based upon the users input. For example, the user is required to enter a validation code (This is a 5 digit code) which is checked when the form is submitted. So if the code is invalid I need to be able to say to the user “You have entered an invalid code” rather than just the generic “You have errors” that is provided.

    Please can you explain to me how I should go about this.

    Should you need my code please let me know.

    Kind Regards
    Marc


    #10005326
    Support
    Keymaster

    Hello, here’s my suggestion:

    JS (view.contact.js)

    $("#contactError").html("<strong>Error!</strong>" + data.error);

    PHP: php/contact-form.php

    Let me know if you need further assistance.

    Kind Regards, Jonas


    #10005340
    marc_berman14
    Participant

    Perfect. Thank you so much.


Viewing 3 posts - 1 through 3 (of 3 total)

This topic is marked as "RESOLVED" and can not rceive new replies.