473,395 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Form field value into another form field?

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
5 1507


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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Matt | last post by:
Can form.submit() submit another form? In the following example, in page1.asp, it is fine to submit the current form: form1.submit(), and and I could see the value "Joe" in page2.asp. However, if I...
3
by: Li Zhang | last post by:
I know I can use controlName.Value to retrieve the form fields value if I am in that page. But if I am out of the page, for example I am in a HttpModule, I want to retrieve a hidden filed value, Is...
1
by: John Davis | last post by:
I am writing a program that allows user to select the date in a calendar, and it will update the text fields automatically. I created 2 forms. The first form has 2 text fields (start date and...
8
by: Mike Caputo | last post by:
In VB.NET, need to be able to access certain properties on my main form from other forms. These are properties that may be changed by the user, so I have to be able to get to them throughout the...
4
by: Michael Murschell | last post by:
If I have Form1 with a text field called Text1 on it, and I want to put information into that field from a second Form (Form2) how would I do it? I would have thought there would have been a way...
4
by: amber | last post by:
Hello I'm trying to open a form from within another form I do this several times, and it works okay, but it won't work for this specific form There are 4 forms that show in the Solutions list, but...
3
by: RBirney | last post by:
When i load a form (frmcontract) in the program i write i can load a contract (cbocontract) as well as many other things, also in this form i can load another form to deal with expenditure...
1
by: Paez | last post by:
Hi there. How can I modify a form control property from another form. Let's say, I have a frmMain that has a ToolStripMenuItem with the current user info. Then, I open another form...
1
by: gourab | last post by:
How to write a code to hide a form and show another form?
3
by: agarwalsunitadhn | last post by:
hello i am working in C#.net. I want to know how to close one form and show another one. I had done the following code this.Hide(); MainForm frm = new...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.