E-mail Form Problem

I

Iain

I have created a form that successfully e-mails the results to the necessary e-mail address and saves the data in a spreadsheet. However, I was wondering if it would be possible to take the values from one or more fields and use them as the subject of the e-mail. Any help appreciated
 
S

Stefan B Rusynko

To combine 2 text form fields (concatenate) you need to create a hidden form field
Right click the form for Form Properties, Advanced, Add,
Name the field (say NewSubject) and give it a default value (say "No Subject Selected").
To do the concatenation (say of 2 text fields named field1 and field2)
- select the submit button and then switch to Html/Code View
- add an onclick event handler (all on 1 line)

onclick="this.form.NewSubject.value = this.form.field1.value + " " + this.form.field2.value;return true;"

So if field1 = ABC and if field2 = DEF then NewSubject field will = ABC DEF when the submit button is clicked
- you may want to make field1 & field2 as required fields using form field validation if you always want a subject other than No
Subject Selected.

To add any field (including your new hidden field as a subject to an email
Right click the form for Form Properties, Options,
- select the Subject Option and enter the Field name (say NewSubject) in the subject box



| I have created a form that successfully e-mails the results to the necessary e-mail address and saves the data in a spreadsheet.
However, I was wondering if it would be possible to take the values from one or more fields and use them as the subject of the
e-mail. Any help appreciated
 
I

Iain

Thanks for you help. Can you confirm that this looks right. This is just trying to pass the one value (Username) into the subject line. When I tried this it gave me an error on the page.

The only thought I had was that FrontPage_Form1_Validator should have remained as simply 'Form'. Can you confirm this too please.

<input type="submit" value="Submit" name="B1" onclick="this.FrontPage_Form1_Validator.Username1.value = this.FrontPage_Form1_Validator.username.value;return true;"><input type="reset" value="Reset" name="B2"></font></p><input type="hidden" name="Username1" value="Enter Username">
 
S

Stefan B Rusynko

1) If you want a user to Enter a name in the field named "Username1", it can't be a hidden field
Change
<input type="hidden" name="Username1" value="Enter Username">
To
<input name="Username1" value="Enter Username">

- you can also move it before the submit button in your page

2) You don't need the onclick event if you are just passing a value from an Existing Visible (user entry) field (in your case
Username1)
- just enter that fieldname in the Subject in form properties

The only time you need the onclick event is if you are trying to combine 2 existing form fields into one using a hidden field

When you apply field validation FP changes the form name to FrontPage_Form1_Validator



| Thanks for you help. Can you confirm that this looks right. This is just trying to pass the one value (Username) into the
subject line. When I tried this it gave me an error on the page.
|
| The only thought I had was that FrontPage_Form1_Validator should have remained as simply 'Form'. Can you confirm this too please.
|
| <input type="submit" value="Submit" name="B1" onclick="this.FrontPage_Form1_Validator.Username1.value =
this.FrontPage_Form1_Validator.username.value;return true;"><input type="reset" value="Reset" name="B2"></font></p><input
type="hidden" name="Username1" value="Enter Username">
 
S

Stefan B Rusynko

user
is the correct field name to enter if you want user to be the subject

What errors do you get w/ the form




| This is the last question, I hope.
|
| I had actually already tried entering the fieldname in the Subject, but everytime I do this, it will not e-mail the form.
| Given the following code:
| <input name="user" size="28" style="border-left:1px solid #0571DC; border-top:1px solid #0571DC; padding:0; float: left;
border-right-width:1; border-bottom-width:1; background-color:#E1F2FF" value="enter your name" tabindex="1"></td>
|
| What variable name should I be putting in the subject field (assuming I wanted to display the username). Would it just be 'user'.
If so, what might the problem be?
 
S

Stefan B Rusynko

Provide a URL to the published form page on the web




| There are no errors displayed.
| In Form Properties I have a link set up to go to a Form Completed page so that we know the form has been submitted. This isn't
happening anymore.
 
Top