Combine first name and last name

J

Jane Here

I have a form that asks for:

Contact name:
Email:

That works fine. However, I find that some people only enter their first
name, so I want to change the form to this:

First name:
Last name:
Email:

When the user clicks Submit, I would like a field included that is made up
of the first two fields, eg realname = 'Bill Jones". So a new field is
created which combines the first two fields.
The code is something like: "realname" = "firstname" + "lastname".

Does anyone know how to do this?
 
S

Stefan B Rusynko

Use Javascript

<form>
<INPUT TYPE="TEXT" NAME="firstname"><br>
<INPUT TYPE="TEXT" NAME="lastname"><br>
<input type="submit" value="Submit" name="Submit" onClick="this.form.realname.value = (this.form.firstname.value) + ' ' +
(this.form.lastname.value)">
<INPUT TYPE="hidden" NAME="realname">
</form>


--

_____________________________________________
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.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I have a form that asks for:
|
| Contact name:
| Email:
|
| That works fine. However, I find that some people only enter their first
| name, so I want to change the form to this:
|
| First name:
| Last name:
| Email:
|
| When the user clicks Submit, I would like a field included that is made up
| of the first two fields, eg realname = 'Bill Jones". So a new field is
| created which combines the first two fields.
| The code is something like: "realname" = "firstname" + "lastname".
|
| Does anyone know how to do this?
|
|
|
|
|
|
 

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