Forum Moderators: mack
I'm setting up a basic email form which when completed sends the entered details to a specified email address, I have no problems with this form, however I want to add a checkbox which when clicked submits a different CGI script and adds the user to our mailing list.
This is the email form:
<form action="http://formmail.dreamhost.com/cgi-bin/formmail.cgi" method="POST">
<div align="left">
<input type="hidden" name="recipient" value="test@test.com">
<input type="hidden" name="subject" value="Competition Entry">
Name:
<input type="text" name="name" size="40" style="width: 300px">
<br />
Email:
<input type="text" name="email" size="40" style="width: 300px">
<br />
<input type="checkbox" name="subscribe" value="subscribe" checked="checked">
Join Mailing List<br>
<br/>
<input type="submit" value="Send">
</div>
</form>
And this is our subscribe form:
<form method="post" target="myNewWin" action="http://scripts.dreamhost.com/add_list.cgi">
<input type="hidden" name="list" value="subscribe" />
<input type="hidden" name="domain" value="domain.com" />
<input type="hidden" name="emailit" value="1" />
Name: <input name="name" size="28"/>
<br/>
Email: <input name="email" size="28"/>
<br/>
<input type="submit" name="submit" value="Subscribe" onClick='sendme();' />
If someone knows how to basically make the checkbox execute the bottom piece of code when submitted that would be very much appreciated!
Thanks
Stuart