EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Steve2106 on November 09, 2019, 03:34:27 AM



Title: Using Checkbox
Post by: Steve2106 on November 09, 2019, 03:34:27 AM
Hi There,

I'm having an issue using a checkbox.
I want to use one checkbox to show something is Active or In-Active.
If it's checked it means active if not checked it's in-active.
On the form declaration it has a value of 0, so it starts off unchecked.
<input class="easyui-checkbox" name="active" value="0" label="Active:">

When I call the save or update how can I know if the checkbox is checked or not.

Thanks for the help.

Best Regards,

Steve.


Title: Re: Using Checkbox
Post by: jahangir on November 10, 2019, 10:22:04 PM
You can get checkbox checked property value like this.

Code:
$('#mychk').checkbox("options").checked


Title: Re: Using Checkbox
Post by: Steve2106 on November 11, 2019, 03:43:28 AM
Hi Jahangir,

Thank you for your reply.
So when I come to edit the record will the checkbox be shown as checked in the form if it's set in the record?

Best Regards,

Steve.