This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Webmaster forum > August 2006 > Form email subject depending on button clicked





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Form email subject depending on button clicked
flightyswine

2006-08-18, 6:39 am

I need to setup a feedback form, probably a PHP one, which will set the
subject of the email depending on which button is clicked. There are
numerous buttons, each associated with a product. eg Button for blue
widgets will set subject in email to "Blue widget enquiry"
Thanks for any help.
CJM

2006-08-18, 6:39 am


"flightyswine" <flightyswine@bigpond.com> wrote in message
news:wFfFg.13970$rP1.7853@news-server.bigpond.net.au...
>I need to setup a feedback form, probably a PHP one, which will set the
>subject of the email depending on which button is clicked.


I would strongly suggest that you save yourself the aggravation and simply
use a dropdown list (or radio buttons etc) to indicate the subject area, and
only have one button.

I assume you have a different page (or at least postback to the original
page) in order to generate the email? If you insist on having several
buttons you will need to use javascript to change the action attribute of
the form to once that contains a querystring to indicate the subject. And
alternative is to use javascript to populate a hidden Subject form field.
And a final alternative is to use javascript to manually post the form to
the processing page with a querystring added on. In each case, javascript is
the key, and therefore you might be better served posting the question on a
javascript-focused NG (eg comp.lang.javascript).

A quick (untested) example: <input id="sendemail" type="submit"
onclick="myForm.action='mypage.php?subject=feedback';">


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews