If a checkbox is not checked, no value is passed to the server. You wont get a null value, you just wont get anything.
You need to keep a local list of all true/false values on the server, then update that list with what you get from the checkbox field from the actionForm and use that to update the DB, or something like that. Or, you can assume that anything not passed is unchecked and set it to "n" or what not. Hope this helps. - Kashif Q. -----Original Message----- From: Chitta Ranjan Mishra [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 2:34 AM To: [EMAIL PROTECTED] Subject: Struts help Dear Sir, Presently I am working on Struts project... I am struggling with one problem since last 2 days regding html:checkbox in Struts. My problem is while inserting data into the database thru a checkbox field... either check or uncheck the checkbox proper value is inserted into the table. Now in case of Updating the same field, suppose then check box was UNCHECKED earlier and if I CHECK it and try to update it ...it's also working fine. But the problem occurs : when the check box was CHECKED earlier and I try UNCHECK it update it ...it's not working. After submitting the request , the value it's taking as the checked value(i.e. in my case if the checkbox is checked then 'Y' should be inserted and if the checkbox is unchecked then 'N' should be inserted) i.e 'Y'. I read from the net that ...if a unchecked checkbox is submitted then the value passed is null ....so i should check in my action class that if it is null, then i should explicitely set it to 'N'. But in my case 'null' is not passed ...the previous value 'Y' is passed . So I reques you kindly pl ...help me what to do . In my jsp page I am doing like this : <html:checkbox name="saListStockUpdateResult" property="dirtAsMetalInd" styleClass="edit" value="Y" indexed="true" /> Here saListStockUpdateResult is a list which contains many values . Now if u say that in the <html:checkbox tag, I should not give like : value="Y" ....even that also i have tried....but the result is same....from the request it's taking the previously stored value..... Even I have used the reset() also in my Action class. But the result was same. So plz help me what to do.It's very urgent... Thanking you, Regds C.R.Mishra ________________________________________________________________________ Yahoo! India Matrimony: Find your partner online. http://yahoo.shaadi.com/india-matrimony/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]