Hey BC community,
Have any of you had a client request that the comment fields be mandatory? I know they're subject to content approval but it has been requested.
Any help would be appreciated,
Cheers,
Pat
Hello Pat,
The comments form uses the same validation as any other form. You just need to add the if statement for the correct field you want to be required.
So for the full name input text field you would add this:
Then for the email address:
Add these on top of the captcha validation, and keep it just like any other form. You can clean up the validation code with http://jsbeautifier.org/
Here is an example:
http://bcg-sandbox.hotpressplatform.com/_blog/Blog/post/nope_this_one_ is/
Hope this helps,
Chad Smith | http://bcgurus.com/Business-Catalyst-Templates for only $7
Hello topelovely,
Not sure why it did not work for you, it is the same code as the fullname field. I've tested this on my sandbox site and this should be the code you need to add to your validation:
if (theForm.Feedback) why += isEmpty(theForm.Feedback.value, "feedback");
I've placed this under the email validation. You can change the "feedback" to say what you want, not when the user doesn't add any feedback the validation pop up says "Please enter feedback".
If this still does not work please post a link or your code and we can go from there. But I hope this works for you =0).
Thanks,
Chad Smith - BC Gurus
North America
Europe, Middle East and Africa
Asia Pacific