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">

Link to comment
Share on other sites

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">

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.