Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Put 2 field values together

Status
Not open for further replies.

planeboy747

Technical User
Joined
Jan 11, 2005
Messages
41
Location
US
I'm trying to have the last name and first name (lname1 and fname1) value fields concataneted in a form confirmation page with a comma, so it appears (Doe, John), here is my code:

function doConfirm() {
var f = document.forms['request'];
f.elements['confirmation1'].value = f.elements['lname1+","+ fname1'].value;

Am I doing this right?
 
Try:

f.elements['confirmation1'].value = f.elements['lname1'].value + "," + f.elements['fname1'].value;

Lee
 


Code:
f.elements['confirmation1'].value = f.elements['lname1'].value + ", " + f.elements['fname1'].value;

*cLFlaVA
----------------------------
[tt]tastes great, less filling.[/tt]
 
sorry lee, got caught up in something else, didn't mean to duplicate.

*cLFlaVA
----------------------------
[tt]tastes great, less filling.[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top