- This topic is empty.
-
AuthorPosts
-
November 7, 2013 at 7:14 am #155378etoilethayParticipant
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?
TIA
November 7, 2013 at 1:33 pm #155400__ParticipantIt 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).
November 7, 2013 at 3:13 pm #155405etoilethayParticipantThanks traq:
Here is the code
http://pastebin.com/mZZWuJbjThe 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.November 7, 2013 at 6:47 pm #155413__ParticipantWell, 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).November 7, 2013 at 8:56 pm #155417etoilethayParticipantI 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 -
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.