Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Live Example: <a href="http://jsfiddle.net/t4BQm/18/" rel="nofollow noreferrer">http://jsfiddle.net/t4BQm/18/</a></p> <p>HTML:</p> <pre><code>&lt;div data-role="page" data-theme="b" id="jqm-home"&gt; &lt;div data-role="content"&gt; &lt;div id="fnameDiv" data-role="fieldcontain"&gt; &lt;label for="name"&gt;Password:&lt;/label&gt; &lt;input id="password" name="password" type="password" placeholder="Password"/&gt; &lt;/div&gt; &lt;div id="fnameDivHidden" class="hidden_div" data-role="fieldcontain"&gt; &lt;label for="name"&gt;Password:&lt;/label&gt; &lt;input id="password_hidden" name="password_hidden" type="text"/&gt; &lt;/div&gt; &lt;div data-role="fieldcontain"&gt; &lt;fieldset data-role="controlgroup" data-role="controlgroup" data-type="horizontal"&gt; &lt;legend&gt;Display Password:&lt;/legend&gt; &lt;input type="radio" name="show_password" id="no" value="no" checked="checked" /&gt; &lt;label for="no"&gt;No&lt;/label&gt; &lt;input type="radio" name="show_password" id="yes" value="yes" /&gt; &lt;label for="yes"&gt;Yes&lt;/label&gt; &lt;/fieldset&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>JS:</p> <pre><code>$('[name=show_password]').change(function() { var show = $('input[name=show_password]:checked').val() == 'yes'; // toggle the password and the hidden text inputs $('#password_hidden').val($('#password').val()); if(show) { $('#fnameDivHidden').show(); $('#fnameDiv').hide(); } else { $('#fnameDivHidden').hide(); $('#fnameDiv').show(); } }); $('#fnameDivHidden').hide(); </code></pre> <p>This might be Related: <a href="https://stackoverflow.com/questions/1544317/jquery-change-type-of-input-field">change type of input field with jQuery</a></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.
 

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