Jump to content

[SOLVED] Radio button changing textboxes value


PyraX

Recommended Posts


<script language="javascript">
function showDetails(val1,val2,val3)
{
document.getElementById('txt1').value = val1;
document.getElementById('txt2').value = val2;
document.getElementById('txt3').value = val3;
}
</script>

<input type="checkbox" onclick="showDetails('Put Value 1 Here','Put Value 2 Here','Put Value 3 Here')">

<br><br>

<input type="text" id="txt1"><br>
<input type="text" id="txt2"><br>
<input type="text" id="txt3">

Oops :D - Change the checkbox to a radio button - Sorry - My fault.

 

Like So:

 

<script language="javascript">
function showDetails(val1,val2,val3)
{
document.getElementById('txt1').value = val1;
document.getElementById('txt2').value = val2;
document.getElementById('txt3').value = val3;
}
</script>

<input type="radio" onclick="showDetails('Put Value 1 Here','Put Value 2 Here','Put Value 3 Here')">

<br><br>

<input type="text" id="txt1"><br>
<input type="text" id="txt2"><br>
<input type="text" id="txt3">

Thats working anyway....

 

I have an idea, how if we use 2 radiobutton and 1 dropdown list menu. When we choose one of the radiobutton and one of lists in dropdown list menu, the value in textbox will change.

 

Can u give me, some code for this one, because i want to make a printing online web complete with calculator. U can see in this link : http://www.printingonline.com.au/OrderA4_booklet.php

 

Pls teach me how to make this work??

 

 

Regards,

 

 

Rudy Siregar

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.