Using this service (http://www.formmail.com) on a form and Ive run into a bit of a problem that after extensive google searching has not given me an answer. I want to add who gets an email if a check box has been checked. Ive tried a few JS and PHP solutions and nothing seems to work. The main problem seems to be how the service does the email proccessing by needing <input type="hidden" name="recipient" value="X">
in the form to determine who to email.
Including the checkbox code although its nothing special
<form method="POST" action="http://fp1.formmail.com/cgi-bin/fm192">
<input name="Checkbox1" type="checkbox" id="Checkbox1" value="Yes"/>
<input type="submit" name="formSubmit" value="Submit"/>
<input type="hidden" name="_pid" value="XXXX">
<input type="hidden" name="_fid" value="XXXX">
<input type="hidden" name="recipient" value="1">
</form>
edit
It send to email 1 now. I want it to also send to email 2 if the checkbox is checked.
Answer. Found out the answer. Stupid thing wont let me self answer however.
<script type="text/javascript" language="JavaScript">
function oncheckboxclick() {
var c = document.getElementById("checkbox1");
var d = document.getElementById("email");
if (c.checked) {
c.checked == true;
d.setAttribute("value", "2");
}
}
</script>
<input name="Box 1" type="checkbox" id="checkbox1" value="Yes" onclick="oncheckboxclick();"/>
<input type="hidden" name="recipient" id="email">
Thanks to whoever put up an answer than retracted it. Gave me enough breadcrumbs to go on.