Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery Radio Button to display different things depen
    primarykey
    data
    text
    <p>What I am trying to do with jQuery is make it so that I can use three radio buttons in the same group with each other. When one is selected the other two shouldn't be active. I want to be able to display separate blocks of HTML in the end result with the jQuery, but I can't get something simple to run right with what I am working with.</p> <p>Here is the code that I have to work with at the moment:</p> <pre><code> $(document.ready(function() { $("input[name='rdiobut']").change(function(){ if ($("input['rdiobut']:checked".val() == 'a')) $("#rdiocont").text("There is no expiration date."); else if ($("input[name='rdiobut']:checked".val() == 'b')) $("#rdiocont").text("Tell me how many days until expire"); else ($("input[name='rdiobut']:checked".val() == 'c')) $("#rdiocont").text("Pick the date to expire from a calendar"); }); }); </code></pre> <p>Here is the table that the jQuery goes to:</p> <pre><code>&lt;tr&gt;&lt;td&gt;Expire Settings:&lt;/td&gt;&lt;td&gt;Does Not Expire: &lt;input type="radio" name="rdiobut" value="a" checked="check" /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt;OR&lt;/strong&gt; Expires By Days &lt;input type="radio" name="rdiobut" value="b" /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt;OR&lt;/strong&gt; Select a Date to Expire On &lt;input type="radio" name="rdiobut" value="c" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="rdiocont"&gt;&lt;td&gt;No Expiration Date&lt;/td&gt;&lt;/tr&gt;&lt;tr id="rdiocont"&gt;&lt;td&gt;Expires by Days&lt;/td&gt;&lt;/tr&gt;&lt;tr id="rdiocont"&gt;&lt;td&gt;Choose Expiration by Calendar&lt;/td&gt;&lt;/tr&gt; </code></pre> <p>Does anyone have any advice or thoughts on what I may be doing wrong?</p>
    singulars
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    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