Form - how do you add something to a field?

J

Jane Here

My FP2003 form asks the user to fill in her "Country".
I would like the form to email me with the subject: "Request for
info"+Country.

This is what I have now:
<input type="hidden" name="Section" value="Request for info">

This is what I am thinking of doing:
<input type="hidden" name="Section" value="Request for info" + COUNTRY>

Is there a syntax available that will do this?


Alternatively, can I store additional text in the COUNTRY field that will
appear in the email that the
form sends to me?

Any suggestions?
 
S

Stefan B Rusynko

You need to put it after the field named COUNTRY and change it to
<input type="hidden" name="Subject" value="Request for info " + this.form.COUNTRY.value>

Then in your form properties select the Subject Field and enter the field named Subject as the subject field
--




| My FP2003 form asks the user to fill in her "Country".
| I would like the form to email me with the subject: "Request for
| info"+Country.
|
| This is what I have now:
| <input type="hidden" name="Section" value="Request for info">
|
| This is what I am thinking of doing:
| <input type="hidden" name="Section" value="Request for info" + COUNTRY>
|
| Is there a syntax available that will do this?
|
|
| Alternatively, can I store additional text in the COUNTRY field that will
| appear in the email that the
| form sends to me?
|
| Any suggestions?
|
|
|
|
|
 
M

MD Websunlimited

AFAIK, that will not work.

Assuming Country is a selection dropdown you'd need something like this.

<select onchange="if (this.selectedIndex > 0) { this.form.Subject.value = 'Request for info ' +
this.form.options[this.selectedIndex].value; " >
 
S

Stefan B Rusynko

Good catch - Thanks

--




| AFAIK, that will not work.
|
| Assuming Country is a selection dropdown you'd need something like this.
|
| <select onchange="if (this.selectedIndex > 0) { this.form.Subject.value = 'Request for info ' +
| this.form.options[this.selectedIndex].value; " >
|
|
| --
| Mike -- FrontPage MVP '97-'02
| J-Bots 2004 Released Special Pricing
| http://www.websunlimited.com
| FrontPage Add-ins Since '97 FP 2003 / 2002 / 2000 Compatible
|
| > You need to put it after the field named COUNTRY and change it to
| > <input type="hidden" name="Subject" value="Request for info " + this.form.COUNTRY.value>
| >
| > Then in your form properties select the Subject Field and enter the field named Subject as the subject field
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| > http://www.net-sites.com/sitebuilder/newsgroups.asp
| > _____________________________________________
| >
| >
| > | My FP2003 form asks the user to fill in her "Country".
| > | I would like the form to email me with the subject: "Request for
| > | info"+Country.
| > |
| > | This is what I have now:
| > | <input type="hidden" name="Section" value="Request for info">
| > |
| > | This is what I am thinking of doing:
| > | <input type="hidden" name="Section" value="Request for info" + COUNTRY>
| > |
| > | Is there a syntax available that will do this?
| > |
| > |
| > | Alternatively, can I store additional text in the COUNTRY field that will
| > | appear in the email that the
| > | form sends to me?
| > |
| > | Any suggestions?
| > |
| > |
| > |
| > |
| > |
| >
| >
|
|
 
J

Jane Here

Can I get some more help with this? I usually do everything in FrontPage
Design, so I am struggling a little with the code. But I am eager to
learn<g>.

I created a form in FP2003. Then I modified Country to contain a list of
country names.
So here is the code (that works):

<td>
<select size="1" name="Country">
<Option Value="USA">United States</Option>
<Option Value="CAN">Canada</Option>
</select></td>

I also have a hidden field for the form:
<input type="hidden" name="Section" value="Request for info">

This is all standard FP2003 code. I haven't added anything else. So far so
good. Now I want to add in your code. So I changed "Country" to:

<td>
<select size="1" name="Country" onchange="if (this.selectedIndex > 0) {
this.form.Subject.value
='Request for info ' +this.form.options[this.selectedIndex].value; " >
<Option Value="USA">United States</Option>
<Option Value="CAN">Canada</Option>
</select></td>

That did not work.

I then changed: this.form.options in the above to this.form.Country but that
did not help.

Can you tell me what is missing?


Stefan B Rusynko said:
Good catch - Thanks

--




| AFAIK, that will not work.
|
| Assuming Country is a selection dropdown you'd need something like this.
|
| <select onchange="if (this.selectedIndex > 0) { this.form.Subject.value = 'Request for info ' +
| this.form.options[this.selectedIndex].value; " >
|
|
| --
| Mike -- FrontPage MVP '97-'02
| J-Bots 2004 Released Special Pricing
| http://www.websunlimited.com
| FrontPage Add-ins Since '97 FP 2003 / 2002 / 2000 Compatible
|
| > You need to put it after the field named COUNTRY and change it to
| > <input type="hidden" name="Subject" value="Request for info " + this.form.COUNTRY.value>
| >
| > Then in your form properties select the Subject Field and enter the
field named Subject as the subject field
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| > http://www.net-sites.com/sitebuilder/newsgroups.asp
| > _____________________________________________
| >
| >
| > | My FP2003 form asks the user to fill in her "Country".
| > | I would like the form to email me with the subject: "Request for
| > | info"+Country.
| > |
| > | This is what I have now:
| > | <input type="hidden" name="Section" value="Request for info">
| > |
| > | This is what I am thinking of doing:
| > | <input type="hidden" name="Section" value="Request for info" + COUNTRY>
| > |
| > | Is there a syntax available that will do this?
| > |
| > |
| > | Alternatively, can I store additional text in the COUNTRY field that will
| > | appear in the email that the
| > | form sends to me?
| > |
| > | Any suggestions?
| > |
| > |
| > |
| > |
| > |
| >
| >
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top