Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Or you culd use:</p> <pre><code>var chk_val = jQuery("input[name='preferedpaymt']:checked").val(); alert(chk_val); </code></pre> <p><strong>EDIT: how to use it!</strong></p> <p><strong>Your inputs:</strong></p> <pre><code>&lt;input type="radio" name="preferedpaymt" value="CheckMailed" id="CheckMailed1" &lt;?php if($paymnt=="CheckMail") {?&gt; checked="checked" &lt;?php }?&gt; /&gt; (a)Check Mailed &lt;input type="radio" name="preferedpaymt" value="PayPal" &lt;?php if($paymnt=="PayPal") {?&gt; checked="checked" &lt;?php }?&gt; /&gt; (b)By PayPal &lt;input type="radio" name="preferedpaymt" value="WireTransfer" id="WireTransfer" &lt;?php if($paymnt=="wireTransfer") {?&gt; checked="checked" &lt;?php }?&gt; /&gt; (c)Wire Transfer To Bank A/c$12 </code></pre> <p>Then lets say you got one tables for each payment choise. ex:</p> <p><strong>NOTE</strong> 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".</p> <pre><code>&lt;table class="payment_table" id="table_CheckMailed" height="200" bgcolor="#00FF33" width="100px;" &gt; &lt;tr&gt; &lt;td&gt; You checked Checked mail &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;table class="payment_table" id="table_PayPal" height="200" bgcolor="#FF0000" width="100px;" &gt; &lt;tr&gt; &lt;td&gt; You checked Paypal &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;table class="payment_table" id="table_WireTransfer" height="200" bgcolor="#CCC" width="100px;" &gt; &lt;tr&gt; &lt;td&gt; You checked wiretransfer &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>Now to the part where jquery comes in handy.</p> <pre><code>&lt;script type="text/javascript"&gt; jQuery(document).ready(function(){ jQuery('.payment_table').hide(); // Hide all tables by default var chk_val = jQuery("input[name='preferedpaymt']:checked").val(); // Grab the value of the selected radio jQuery('#table_'+chk_val).slideDown(1000); // Slides down the right table on page load. }); &lt;/script&gt; </code></pre> <p>Well there you go, should do the trick for you. Im not the best at explaining but it should be pretty straightforward.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload