EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: aiit on May 07, 2019, 05:16:37 AM



Title: [SOLVED]How can I set checkbox and radiobutton readonly?
Post by: aiit on May 07, 2019, 05:16:37 AM
How can I set checkbox and radiobutton readonly? Thanks.


Title: Re: How can I set checkbox and radiobutton readonly?
Post by: jahangir on May 07, 2019, 06:09:38 AM
Try this
This will  work for both checkbox and radiobutton.
Code:
<input type="checkbox" onclick="return false;"/>


Title: Re: How can I set checkbox and radiobutton readonly?
Post by: aiit on May 07, 2019, 07:25:29 AM
Try this
This will  work for both checkbox and radiobutton.
Code:
<input type="checkbox" onclick="return false;"/>
/code]

thanks, but it is easyui-checkbox and easyui-radiobutton


Title: Re: How can I set checkbox and radiobutton readonly?
Post by: jahangir on May 07, 2019, 09:25:17 PM
Set disabled property to true.
Code:
 <input class="easyui-checkbox" disabled="true" name="fruit" value="Apple" label="Apple:">

or try this to make it readonly but not disabled..

Code:
<input class="easyui-checkbox" name="fruit" value="Apple" label="Apple:" 
    data-options="
onChange:function(checked){
  $(this).checkbox({checked: !checked});  
}
">


Title: Re: How can I set checkbox and radiobutton readonly?
Post by: stworthy on May 07, 2019, 11:54:19 PM
Please set the 'readonly' property. Make sure to download the newest version from the site.


Title: Re: How can I set checkbox and radiobutton readonly?
Post by: aiit on May 08, 2019, 07:18:30 PM
Thank you very much.


Title: Re: How can I set checkbox and radiobutton readonly?
Post by: aiit on May 08, 2019, 07:19:16 PM
Please set the 'readonly' property. Make sure to download the newest version from the site.

Thank you!
Now all is working properly!