PDA

View Full Version : Form results - I don't need all


Finland Blue
11-20-2005, 08:38 PM
I have a form ready to post on my web site - the user will fill in the form and the results come to me via an email.

I don't want one of the form elements results to be included in that email - is there a way to NOT include it?

Thanks

davidj
11-21-2005, 09:17 AM
i need to know how your sending the mail

cgi or php or asp

please post the code

Finland Blue
11-21-2005, 10:10 AM
Thanks David :

Trust this is what you need :

<td><form name="form1" form action="http://www.mywebsite.com/server-cgi/FormMail" method="post">
<input type=hidden name="recipient" value="info@mywebsite.com">
<input type=hidden name="subject" value="Request">
<input type=hidden name="redirect" value="http://www.mywebsite.com/index.htm">

davidj
11-21-2005, 10:13 AM
these are all hidden fields

which form element do you want to omit

Finland Blue
11-21-2005, 10:53 AM
It will be a text area - something like this :

<textarea name="textarea" cols="35" rows="10">

This is a text box part of the form, but I don't want that included on the email I get back after "submit" is pressed.

davidj
11-21-2005, 10:55 AM
where does the text go from that textarea

Finland Blue
11-21-2005, 10:59 AM
That text will be "read only" so it won't actually go anywhere. As the text comes within the form though, it comes on the email I receive, and as its so long, I don't want it to come to me.

davidj
11-21-2005, 11:08 AM
you could do the submit through javascript but i need to know more

what are you doing with the input data of that text area? is it going to a database? or are you just ignoring it

Finland Blue
11-21-2005, 11:23 AM
The textarea I don't want to see on the email is something users just read - they do not input anything in it.

Perhaps this is easier than I think - can I put a scrolling text box within a form that is not "active" - I mean, its just text that users read, but is not included in the form results I receive? (it needs to be a scrolling text area, as its a lot of information I need to include in a relatively small space).

davidj
11-21-2005, 11:23 AM
ok

you could place the textarea outside the <form> tag so its not processed
or you could write a small javascript function to handle it

// change textarea1 to what ever you named that field


function sendmail(){
document.form1.textarea1.value = '';
document.form1.action ="http://www.mywebsite.com/server-cgi/FormMail"
document.form1.submit();

}


document.form1.textarea1.value = ''; clears the contents of that field to null or empty

change your [submit button] to a [button] and asign onClick="sendmail()"

Finland Blue
11-21-2005, 11:33 AM
Thanks - I will try that.

The textarea is right in the middle of the form, so I am not sure if its right or easy to end the form, and then start it again afterwards?

The code solution looks a better solution - just a quick question, as I am no expert - am I right to put the code between the head tags at the top?

Thanks for your help, appreciated.

davidj
11-21-2005, 11:33 AM
can I put a scrolling text box within a form that is not "active"

you dont need to use a <form> when adding fields your not doing anything with.

Think of a <form> as an envelope. anything outside of the envelope wont be sent

davidj
11-21-2005, 11:37 AM
am I right to put the code between the head tags at the top?


yes. Write that function inside the head tags. Make sure you wrap the function in <script> tags

Finland Blue
11-21-2005, 11:39 AM
OK, thanks - I will try it and let you know how it goes.

Kiitos!

davidj
11-21-2005, 11:51 AM
sorry
i use dynamic forms all the time so i can pass data to different processes
i added this line in that function
document.form1.action ="http://www.mywebsite.com/server-cgi/FormMail"
you dont need that in the function as it is set in your form tag
its a habbit - sorry

revised..

function sendmail(){
document.form1.textarea1.value = '';
document.form1.submit();

}