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!

onClick not working to populate other form value

Status
Not open for further replies.

planeboy747

Technical User
Joined
Jan 11, 2005
Messages
41
Location
US
My function "doConfirm" is not displaying the results of field id "agency" into field id "confirmation1". I'm using a onClick function to populate, but it's not working, below is all my code, any ideas?

I'm thinking, do I need to call a document.write or something??

Thanks



-----Script-----

function reviewConfirm()
{
var elem = document.getElementById("reviewConfirm");
elem.style.display = "block";
document.getElementById('second').style.display = 'none';
}

function doConfirm() {
var f = document.forms['request'];
f.elements['confirmation1'].value = f.elements['agency'].value;
}


-----onClick button-----

<a href="#confirm"><img src="images/continue.gif" value="click" alt="Continue" width="83" height="17" border="0" onclick="reviewConfirm();doConfirm();">


-----Results Displayed in HTML------

<table width="550" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="26" colspan="2" valign="top"><a name="confirm"></a>Confirm
Your Request</td>
</tr>
<tr>
<td colspan="2">Before you submit your request, please confirm your
entries below for accuracy. You can change any information by using
the back button below.</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td height="25" colspan="2" valign="top" >Agency
Information</td>
</tr>
<tr>
<td width="148" height="20">Agency name:</td>
<td width="402" height="20" id="confirmation1">&nbsp;</td>
</tr>
</table>
 
? The html you showed does not match to the JavaScript you showed. Where are the elements with ids of "reviewConfirm" and "second", and where is the form with id of "request" and where are the form elements with names of "confirmation1" and "agency"?

*cLFlaVA
----------------------------
[tt]tastes great, less filling.[/tt]
 
the reviewConfirm function is just a function to hide areas of content on the page, which are hidden between div tags, do you still need the code, it's quite long the entire form? My form is working right with that function, it's just the doConfirm function I can't get to work right.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top