PDA

View Full Version : Cannot get checkbox value



yugikhoi
9 Sep 2010, 6:09 PM
Hi,

I made an textbox in a form panel. When I submit form, I can get checkbox value only it is checked. When it noncheck, its value always null. How can i set the value of checkbox when it is noncheck. Below is my code for checkbox:




xtype: 'checkbox',
boxLabel: 'Yes',
name: 'myChK',
inputValue: 'Y',
value: 'N'



Thanks.

evant
9 Sep 2010, 8:13 PM
You can't. The HTML spec indicates that only checked checkboxes are sent to the server.

yugikhoi
9 Sep 2010, 8:15 PM
Ok, thanks so that I need to double check it at the server code.

Condor
9 Sep 2010, 11:06 PM
There is an XCheckbox user extension that solves this by using a <input type="hidden"> to hold the value instead of using the checkbox itself.