Hi, I need to add a javascript parameter to my comments form in order to validate a checkbox. I’ve added this code but it is not being displayed:
{exp:comment:form weblog="weblog" onsubmit="return validate_form(this);"}
Thank you.
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
June 03, 2009 6:13am
Subscribe [2]#1 / Jun 03, 2009 6:13am
Hi, I need to add a javascript parameter to my comments form in order to validate a checkbox. I’ve added this code but it is not being displayed:
{exp:comment:form weblog="weblog" onsubmit="return validate_form(this);"}
Thank you.
#2 / Jun 03, 2009 6:25am
I am afraid there is no onsubmit parameter for the exp:comment:form tag. Perhaps you could create the form yourself, like an SAEF? Moving to Howto.
#3 / Jun 03, 2009 7:24am
The problem is that if I create a form myself, I don’t know how to save the user information for further submissions.
#4 / Jun 04, 2009 6:02am
I’ve solved this problem adding the function on a button instead of the form tag. Thanks.
#5 / Jun 04, 2009 6:03am
Very good idea, actually 😊 Thanks for letting us know.