How involved would it be to add a checkbox (defaulted to unchecked) that must be checked before the comment is submitted?
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
October 04, 2007 1:31pm
Subscribe [0]#1 / Oct 04, 2007 1:31pm
How involved would it be to add a checkbox (defaulted to unchecked) that must be checked before the comment is submitted?
#2 / Oct 08, 2007 12:13pm
Ok, two posts since Sept 26 that have went completely unanswered. Do I offend? *sniffs armpits* 😊
#3 / Oct 08, 2007 12:25pm
It depends on what you need. Does the checkbox need to store information in the database? Or simply need to be checked before submission? If the former, you could easily use a javascript validation, I’d imagine, though I haven’t done it myself. If the former, a module or extension might be best.
#4 / Oct 08, 2007 12:32pm
Thanks for the reply Lisa. The checkbox is simply a “I agree to the terms or service” kind of thing that they must check before they would be allowed to submit their comment. A javascript validation sounds about right but how do add that extra checkbox into the comment form?
#5 / Oct 08, 2007 12:41pm
You would just add the normal code for a checkbox, and make sure that the JS validation checked it before allowing it to go through. You might consider wrapping it in member conditionals, as members do agree to a TOS when joining - or can, if you have the options checked for that.
I unfortunately can’t help with code here - I’m not good with Javascript, but there are lots of examples of JS validation out there on google, and you can probably find some for your favorite library, if you have one. =)
#6 / Oct 08, 2007 1:06pm
Hmm, I have the validator running but I don’t know how to integrate it into the comment form tag. Anyone have any ideas on how to pull this off?
#7 / Oct 09, 2007 5:36pm
how involved is it to have the data stored in the user’s profile? I’d like to have newsletter subscriptions tied to the user profile.
#8 / Oct 09, 2007 6:20pm
latte02125: I don’t know if that question was meant for me or as a follow-up to mine but in case it’s for me I don’t need anything from the checkbox stored in the user’s profile. I just want them to be required to checking the box before they can submit the comment.