Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS PHP contact form not showing error color

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #155378
    etoilethay
    Participant

    To reduce spam, I implemented a php contact form that validates input and if there is an error, the box border would turn red. I am not getting the red border for this form. Can someone help me troubleshoot?

    http://goo.gl/XJFISK

    TIA

    #155400
    __
    Participant

    It would be impossible to say without seeing your PHP. You can use a service like pastebin or make a gist on github (the forums work fine for a line or two, but it gets difficult with larger amounts of code). You should also describe what you expect to happen (compared to what actually happens).

    #155405
    etoilethay
    Participant

    Thanks traq:
    Here is the code
    http://pastebin.com/mZZWuJbj

    The form is designed in away that if the input is not valid and after clicking the submit button, the input box with error should have a red border rather than black.
    In my case the border color stays black and hence the user will not know what input is supposed to be corrected.

    #155413
    __
    Participant

    Well, have a look at this section:

    <?php // if there are recaptcha errors show a message ?>
      <?php if ($captchaErrorMsg){ ?>
        <p>Captcha error. Please, type the check-words again.</p>
      <?php } ?>
    

    That error message is output to the page, so we know that the PHP is catching the error correctly.

    = = = = = edit

    When I checked your page this morning, it correctly showed the error message, but it does not do so any longer. Have you made any changes?

    /edit = = = = =

    The form is designed in away that …

    Not exactly.

    If you take a look at the docs, you’ll see that the script provides “hook” classes for to allow you to create such style rules. The recaptcha_only_if_incorrect_sol class seems like the best choice to use in this case (there is an example implementation right above the section I linked to).

    #155417
    etoilethay
    Participant

    I had a silly mistake. I did not link to the right css, but now it is corrected. The form is checking but the red border is only showing for the message input and not the other input boxes. Validation is still working for the other boxes but no red border. I guess my css file is working now. I think the problem now is with php file and not the css, but I just can’t see it. Can you take a quick look again?
    TIA

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.