Note that there are some explanatory texts on larger screens.

plurals
  1. POformulization in jquery using values
    primarykey
    data
    text
    <p>I m learning jquery a bit so i created this fiddle here <a href="http://jsfiddle.net/8FXFE/17/" rel="nofollow">http://jsfiddle.net/8FXFE/17/</a></p> <p>this is my html code</p> <pre><code>&lt;div class="textForm"&gt; &lt;input type="radio" name="txtNumber" value="100" checked="checked" /&gt;100 &lt;input type="radio" name="txtNumber" value="200" /&gt;200 &lt;input type="radio" name="txtNumber" value="500" /&gt;500 &lt;input type="radio" name="txtNumber" value="1000" /&gt;1000 &lt;input type="radio" name="txtNumber" value="10000" /&gt;10000 &lt;input type="radio" name="txtNumber" value="other" /&gt;other &lt;input type="text" name="other_field" id="other_field" onblur="checktext(this);" /&gt; &lt;/div&gt; &lt;div class="formText"&gt; &lt;input type="radio" name="txtSpace" value="RJ" checked="checked" /&gt;Space 1. &lt;br /&gt; &lt;input type="radio" name="txtSpace" value="SM" /&gt;Space 2. &lt;br /&gt; &lt;/div&gt; &lt;h3&gt;Output:&lt;/h3&gt; </code></pre> <p>this is css</p> <pre><code>#other_field { display: none; } </code></pre> <p>this is jquery</p> <pre><code>$(document).ready(function () { console.log("parsed"); $("input[name='txtNumber'],input[name='txtSpace']").change(function () { $("#output").text("Changed to "+$("input[name='txtNumber']:checked").val() + " " +$("input[name='txtSpace']:checked").val() + " +++++SOME FIXED VALUE OF TXTSPACE (i.e. SAY if RJ = 100 or if SM = 50) x VALUE OF TXTNUMBER++++++" ); }); }); $(':radio').on('change', function () { $('#other_field')[$(this).val() === 'other' ? 'show' : 'hide'](); }); $('#other_field').on('blur', function () { var val = $(this).val(); if(isNaN(val)) { alert('only numbers are allowed..'); } else if(parseInt(val, 10) % 10 &gt; 0) { alert('only multiples of 10..'); } }); </code></pre> <p>How can i achieve actual output those shown in capital letters inside +++++++++++ SOME FIXED VALUE OF TXTSPACE (i.e. SAY if RJ = 100 or if SM = 50) x VALUE OF TXTNUMBER</p> <p>Also How can i add dynamic value of hidden other_field (if selected)</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. 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