PDA

View Full Version : simple form help



FunaGuy
02-03-2007, 12:55 AM
see,

links to form with subject target

http://www.xxx.com/contact.htm?=Report
http://www.xxx.com/contact.htm?=Request

After this contact form subject text field get call target and put in subject field automatic visitor dont need to write if they want to put custom text in subject then only give link like this http://www.xxx.com/contact.htm but dont show any thing in subject field hope u understand and help me in this...sorry for ma bad english

FunaGuy
02-03-2007, 04:14 AM
help me

tech_support
02-03-2007, 05:28 AM
Is this some sort of ****ography site? No can do then.

FunaGuy
02-03-2007, 05:51 PM
no...XXX its just example of website link...LOL

plz help me

boxxertrumps
02-03-2007, 08:50 PM
yeah... use www.example.com/webpagex or something, xxx.com is a real **** website...

tech_support
02-04-2007, 04:16 AM
...and I'm under 18 so I can't enter.

Anyway, what do you want? I don't know what you mean.

thetestingsite
02-04-2007, 04:23 AM
I think what the OP means is when you go to contact.htm, you get a contact form with a subject field for the user to type in. If you go to contact.htm?=Reports, the subject becomes Reports or something like that.

Well, my answer for this is you cannot do it with just HTML. You might be able to with Javascript (doubt it though, but you never know). You can; however, accomplish this with PHP. I currently don't have time to post the code for it, but the idea is simple. Have a variable (let's say $subject). See if it is set or not. If so, do not display subject field and use that as your subject in the mail. Else, display a field for the user to type into.

Hope this helps.

tech_support
02-04-2007, 04:43 AM
<script type="text/javascript">
function getVar(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
return "";
}
var to = "theemailhere@example.com"
function mail() {

window.location="mailto:" + to + "?subject=" + getVar('subject')
}
</script>