Connecting Tech Pros Worldwide Forums | Help | Site Map

Populating a hidden text box with same data as other text box

Newbie
 
Join Date: Jan 2008
Posts: 17
#1: Feb 29 '08
Sample code snippet -

<td align="right">Check Amount:&nbsp;</td>

(1) <td><input type="text" name="CHK_input_1" size="19"style="text-align:right" onkeyup="calcCB();" onBlur="currency(this); calcCB();" tabindex="26">

(2) <input type="hidden" name="OBKey__53_1" id="kw_check_amount" >

For various database reasons, I need to be able to populate a hidden field to be used as a keyword in our system based on the first input field.
For instance, I need to enter a check amount into field (1) at the same time I need to populate the hidden text field (2) with the same data.
All references I have found so far are for populating textbox through a dropdown list. This is not what I need to do.
Do I need to create a method to populate the hidden field with the same information?
I would need to do this multiple times on the same form. If so How would I go about performing this?
Is there any easier way to populate both form fields at the same time?

rnd me's Avatar
Expert
 
Join Date: Jun 2007
Location: Urbana IL
Posts: 411
#2: Mar 1 '08

re: Populating a hidden text box with same data as other text box


Expand|Select|Wrap|Line Numbers
  1. (1)    <td><input type="text" name="CHK_input_1"  size="19"style="text-align:right"  onkeyup="calcCB();" onBlur="currency(this); calcCB();"  tabindex="26"    onchange="document.getElementById('kw_check_amount').value=this.value">
  2. (2)    <input type="hidden" name="OBKey__53_1" id="kw_check_amount" >      
  3.  

ED:
there seems to be something weird above, and i can't seem to edit it out, but there is no space in the word 'this'...
Newbie
 
Join Date: Jan 2008
Posts: 17
#3: Mar 3 '08

re: Populating a hidden text box with same data as other text box


Thanks for saving me again. U Rock!
Reply


Similar JavaScript / Ajax / DHTML bytes