...

View Full Version : Send Radio Button Form Results to Two Email Addresses...



tulip
11-13-2004, 04:37 AM
How would one build a form with the following criteria:

1.) Two radio buttons (Subscribe) and (Unsubscribe)
2.) A text box to enter an email address
3.) Submit button which will send all (Subscribe) requests to one email address and all (Unsubscribe) requests to another email address

Any input would be greatly appreciated!

Nina

homerUK
11-13-2004, 12:45 PM
assuming you are using an ASP, or PHP (or similar) language to post the data to, I would do something like this: (using PHP in this case)



<script type="text/javascript">
function decide(what) {
document.formname.todo.value = what;
document.formname.submit();
}
</script>

<form name="formname" method="post" action="">
<input type="hidden" name="todo">
<p>Email Address: <input type="text" name="email"></p>
<p>
<input type="button" value="Subscribe" onclick="decide('subscribe')">
<input type="button" value="Unsubscribe" onclick="decide('unsubscribe')">
</p>
</form>


Once the user presses on of the buttons, they will populate the hidden form tag called "todo". You can then do something on the next page which would sub or unsubscribe them.

Hope that helps :)

glenngv
11-13-2004, 01:37 PM
<form name="formname" method="post" action="">
<p>Email Address: <input type="text" name="email"></p>
<p>
<input type="submit" name="btnSubscribe" value="Subscribe" />
<input type="submit" name="btnUnsubscribe" value="Unsubscribe" />
</p>
</form>

Then in the server-side code, check which button is clicked by looking at the value of btnSubscribe and btnUnSubscribe form data. Only the one clicked will be submitted to the server.

tulip
11-14-2004, 06:56 AM
assuming you are using an ASP, or PHP (or similar) language to post the data to, I would do something like this: (using PHP in this case)



<script type="text/javascript">
function decide(what) {
document.formname.todo.value = what;
document.formname.submit();
}
</script>

<form name="formname" method="post" action="">
<input type="hidden" name="todo">
<p>Email Address: <input type="text" name="email"></p>
<p>
<input type="button" value="Subscribe" onclick="decide('subscribe')">
<input type="button" value="Unsubscribe" onclick="decide('unsubscribe')">
</p>
</form>


Once the user presses on of the buttons, they will populate the hidden form tag called "todo". You can then do something on the next page which would sub or unsubscribe them.

Hope that helps :)


I should have told you that I was extremely in the dark on this one. I have built my site (http://www.tuliptopia.com) solely on asking questions and reading, reading, and reading.

I know little to nothing about ASP or PHP. I have a hosting company with the email through them, accessed via OE6.

Any additional information/assistance would be greatly appreciated!

Thanks again,
Nina



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum