Support » Plugin: Contact Form 7 » [Plugin: Contact Form 7] Need validation help

  • I’m having a lot of trouble getting my form to validate correctly. I’m using the Contact Form 7 Jquery plugin as well but even when I deactivate it I’m still having issues.

    I’ve created a javascript file to enable show/hide functionality and that is working fine. The problem I’m having is that when I try to make one of the hidden fields required (which I really need to do) and I specify that it should only be required if visible, I’m running into validation errors and the form won’t submit. Here’s the link to my test form. If you click the first radio button and try submitting it returns an error because there’s a field which appears when the second radio button is selected. I’ve checked the javascript in and it works fine and I was told (I’m not really a coder as you can tell 🙁 ) that the problem is in the server side php code somewhere in the Contact Form 7 plugin files. I was told that I need to specify something about validating only fields whose value > 0 and I’m not sure where or how exactly to do that since there are so many php files. Has anyone accomplished this? Can someone point me in the right direction or explain it more clearly to me? css, html, and design are more my thing and this coding thing is making me feel super dumb :-/


Viewing 2 replies - 1 through 2 (of 2 total)
  • oops I updated the jquery version last night and forgot to update the header.php file so the show/hide wasn’t working and the error couldn’t be reproduced. It is back to having the validation error. Thanks to whoever tried to help me till now.

    I still need help.

    I’ve looked around some more and added this

    $('.hide input').val('n/a');

    to my javascript. The weird thing, is that it actually fills in all the hidden fields with “n/a” even if only the first radio button is selected, so no fields are empty but unless the 2nd radio button is selected (that’s the one that has the additional fields AND one is a required field) I get the yellow error “Validation errors occurred. Please confirm the fields and submit it again.” and it doesn’t submit.

    Any ideas of what I can change in the javascript or php to get this to work? link to my test form

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Contact Form 7] Need validation help’ is closed to new replies.