Text Input Methods

Description

The textinput plugin has the following methods:

enable: enable a disabled textinput or textarea.

$( "textarea" ).textinput( "enable" );

disable: disable a textinput or textarea.

$( "textarea" ).textinput( "disable" );

Example


<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type='text/javascript'>//<![CDATA[ 
$(function(){<!--from ww w .j a v  a2s .c  om-->
$('#index').live('pagebeforeshow',function(e,data){    
  $('#Input1').textinput('disable');
    $('#Input2').textinput('enable');
});
});//]]>  
</script>
<link rel="stylesheet"
  href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />

<script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>


</head>
<body>
  <div data-role="page" id="index">
    <div data-theme="a" data-role="header">
      <h3>First Page</h3>
      <a href="#second" class="ui-btn-right">Next</a>
    </div>
    <div data-role="content">
      <fieldset data-role="controlgroup">
        <input id="Input1" /> 
        <input disabled="disabled" id="Input2" />
      </fieldset>
    </div>
    <div data-theme="a" data-role="footer" data-position="fixed"></div>
  </div>


</body>
</html>

Click to view the demo





















Home »
  jQuery Mobile »
    Tutorial »




jQuery_Mobile
Form
List
Layout
Theme