I have 3 radio buttons
<input type="radio" name="preferedpaymt" value="CheckMailed" id="CheckMailed1" <?php if($paymnt=="CheckMail") {?> checked="checked" <?php }?> />
(a)Check Mailed
<input type="radio" name="preferedpaymt" value="PayPal" <?php if($paymnt=="PayPal") {?> checked="checked" <?php }?> />
(b)By PayPal
<input type="radio" name="preferedpaymt" value="WireTransfer" id="WireTransfer" <?php if($paymnt=="wireTransfer") {?> checked="checked" <?php }?> />
(c)Wire Transfer To Bank A/c$12
But the value of radiobutton is checked from database . With these 2 tables are associated
if Radiobutton 2 is checked table1 1 should populate id tb1
here the problem is when a value of radio button is checked from database the table does not get populate if you only click it gets populated i want it automatis how can i do it?
jquery code, which I am using
<script type="text/javascript">
jQuery(function () {
jQuery("input[name=preferedpaymt]").change(function () {
if ($(this).val() == "PayPal") {
jQuery("#ppl").slideDown()
} else {
jQuery("#ppl").slideUp();
}
});
});
</script>
Or you culd use:
EDIT: how to use it!
Your inputs:
Then lets say you got one tables for each payment choise. ex:
NOTE All tables has the same classname this is because i want to hide all of them by default. The id attribute is set to “table_paymentmethod”.
Now to the part where jquery comes in handy.
Well there you go, should do the trick for you. Im not the best at explaining but it should be pretty straightforward.