I am having two text boxes namely Amount 1 and Amount 2 as like below..
<input name="name1" id="id1" value="" type="radio" > Amount 1 $ <input name="amtname" size="5" maxlength="7" value="" ><br><br>
<input name="name1" id="id2" value="" type="radio" > Amount 2 $ <input name="amtname" size="5" maxlength="7" value="" ><br>
If I type any value in Amount 1 text box, it should display the same value in Amount 2 text box by getting runtime value from Amount 1 Text box. And If I click on Amount 1 Checkbox, it should display the value of Amount 1 Text box in Amount 2 Text Box. Is it possible using javascript?
Add a onkeyup
event listener to your first element(Whenever a key is pressed, the value in first textbox is also entered in second.). Then call the function like
function enterAmt(ev) {
document.getElementById('amt2').value = ev.value;
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments