By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,483 Members | 1,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,483 IT Pros & Developers. It's quick & easy.

Form field value into another form field?

P: n/a
I have a form that submits some js created data through a formmail script.
One field of the form is a text box for the person's name. I'd like the
subject line of the resulting email to be "Some Specific Text " + the_name.

I believe it's possible, but am lost as to the strategy?

TIA,
Larry L
Jul 23 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a


Simple:

documet.FORMNAME.ELEMENTNAME.value='YOUR TEXT
HERE'+documet.FORMNAME.ELEMENTNAME.value;

Danny
On Thu, 30 Jun 2005 19:51:34 -0700, Larry <no***@none.com> wrote:
I have a form that submits some js created data through a formmail
script.
One field of the form is a text box for the person's name. I'd like the
subject line of the resulting email to be "Some Specific Text "
+ the_name.

I believe it's possible, but am lost as to the strategy?

TIA,
Larry L


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Jul 23 '05 #2

P: n/a
Zif
Danny wrote:


Simple:

documet.FORMNAME.ELEMENTNAME.value='YOUR TEXT
HERE'+documet.FORMNAME.ELEMENTNAME.value;

Danny


Please do not top-post. Read the FAQ:

<URL:http://www.jibbering.com/faq>

Manually wrap lines of code, allowing auto-wrapping introduces errors.
Your code should work when copied and pasted without correction.

--
Zif
Jul 23 '05 #3

P: n/a
Zif
Larry wrote:
I have a form that submits some js created data through a formmail script.
One field of the form is a text box for the person's name. I'd like the
subject line of the resulting email to be "Some Specific Text " + the_name.

I believe it's possible, but am lost as to the strategy?


Do you mean formmail as in a server script (e.g. PHP, Perl, etc.)? If
so, do it at the server. Making your page dependent on JavaScript for
no good reason is pointless.

If you want to show your visitor what the subject will be before the
form is sent, do something like:

<form action="">
<input type="text" name="uName" size="50">Enter your name<br>
<input type="text" name="uSub" size="50" onchange="
this.form.gSub.value = this.value + ': ' + this.form.uName.value;
">Enter a subject<br>
<input type="text" name="gSub" size="50" readonly
style="border-width:0;" onfocus="
if(this.blur)this.blur();
"><br>
</form>
--
Zif
Jul 23 '05 #4

P: n/a
In article <aB******************@news.optus.net.au>, Zif <zi***@hotmail.com> wrote:
Larry wrote:
I have a form that submits some js created data through a formmail script.
One field of the form is a text box for the person's name. I'd like the
subject line of the resulting email to be "Some Specific Text " + the_name.

I believe it's possible, but am lost as to the strategy?
Do you mean formmail as in a server script (e.g. PHP, Perl, etc.)? If
so, do it at the server. Making your page dependent on JavaScript for
no good reason is pointless.


Not "for no good reason". The formmail script is indeed perl, but is used for
several different forms on the site. THIS page collects test data then
asks for a name and emails the results.
If you want to show your visitor what the subject will be before the
form is sent, do something like:
The user won't actually even see the email subject line, but it needs to start
with the same text each time so as to be correctly processed by the receiving
email client.
<form action="">
<input type="text" name="uName" size="50">Enter your name<br>
<input type="text" name="uSub" size="50" onchange="
this.form.gSub.value = this.value + ': ' + this.form.uName.value;
">Enter a subject<br>
<input type="text" name="gSub" size="50" readonly
style="border-width:0;" onfocus="
if(this.blur)this.blur();
"><br>
</form>


Thanks, I'll try a version of that. FYI, here's what I'm currently using -

Code to create $test_results

in Head
function assignvar() {
document.sendit.testresults.value=$test_results;
}

in Body
<form name="sendit" method="post" action="/cgi-bin/FormMail.pl"
onsubmit="return assignvar()">
Your Name <input type="text" name="Name_Entered" size="30">
<input type="hidden" name="subject" value="Test Results From - ">
<input type="hidden" name="from" value="Test 60">
<input type="hidden" name="testresults" value="None">
<input type="submit" value="Send Results" name="submit"></p>
</form>

Thanks,
Larry L
Jul 23 '05 #5

P: n/a
In article <1120188267.40832ff5433d644d0e5ce277a5d93a09@teran ews>, Danny <da*******@bluebottle.com> wrote:


Simple:

documet.FORMNAME.ELEMENTNAME.value='YOUR TEXT
HERE'+documet.FORMNAME.ELEMENTNAME.value;

Danny


Casual to the most obvious observer!
Thanks, Larry L

On Thu, 30 Jun 2005 19:51:34 -0700, Larry <no***@none.com> wrote:
I have a form that submits some js created data through a formmail
script.
One field of the form is a text box for the person's name. I'd like the
subject line of the resulting email to be "Some Specific Text "
+ the_name.

I believe it's possible, but am lost as to the strategy?

TIA,
Larry L


Jul 23 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.