textbox.htm 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title></title>
  5. <link href="../../lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  6. <style type="text/css">
  7. </style>
  8. <script src="../../lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  9. <script src="../../lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  10. <script src="../../lib/ligerUI/js/plugins/ligerTextBox.js" type="text/javascript"></script>
  11. <script type="text/javascript">
  12. $(function ()
  13. {
  14. $("#txt1").ligerTextBox({ nullText: '不能为空' ,label:'LABEL'});
  15. $("#txt1").ligerTextBox({ nullText: '不能为空222' ,label:'LABEL44'});
  16. $("#txt2").ligerTextBox({ initValue: '不能为空' ,label:'设置初始值', labelWidth:100, labelAlign:'right'});
  17. $("#btnSet").bind('click',function(){
  18. $("#txt1").ligerGetTextBoxManager().setValue('设置值');
  19. });
  20. $("#btnGet").bind('click',function(){
  21. alert($("#txt1").ligerGetTextBoxManager().getValue());
  22. });
  23. $("#btnDisabled").bind('click',function(){
  24. $("#txt1").ligerGetTextBoxManager().setDisabled();
  25. });
  26. $("#btnEnabled").bind('click',function(){
  27. $("#txt1").ligerGetTextBoxManager().setEnabled();
  28. });
  29. });
  30. </script>
  31. </head>
  32. <body style="padding:10px">
  33. <input type="button" id="btnSet" value="设置值" />
  34. <input type="button" id="btnGet" value="获取值" />
  35. <input type="button" id="btnDisabled" value="设置只读" />
  36. <input type="button" id="btnEnabled" value="取消只读" />
  37. <div>
  38. <input type="text" id="txt1" value="" style="width:200px"/>
  39. </div>
  40. <div>
  41. <input type="text" id="txt2" value=""/>
  42. </div>
  43. <div style="display:none;">
  44. </div>
  45. </body>
  46. </html>