NetTalk Central

Author Topic: CheckBox not storing value  (Read 3334 times)

Mark Sarson

  • Newbie
  • *
  • Posts: 33
    • View Profile
    • Email
CheckBox not storing value
« on: May 16, 2011, 06:50:59 PM »
Hi

I have a byte field in my dct. In the DCT its validation is set to true or false.

In my form I have the field set as Checkbox and set true value to 1 and false to 0.

To make sure I wasn't going mad, I placed a stop statement in ValidateUpdate, and the value is showing correctly.

However when I go back to the form after a save, the value isn't being saved.

I then decided to play around a bit. I set the field to be a string rather than checkbox, and the value does get saved.

Ive tried every combination I can think of to try and find out why it won't save when its a checkbox. Ive set the true/false values in the dct. Changed the true/false values on the form, to no avail.

Any thoughts would be appreciated.

Regards

Mark

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: CheckBox not storing value
« Reply #1 on: May 16, 2011, 11:11:03 PM »
I've got checkboxes in a few places Mark - and they seem ok, so perhaps an example is necessary?

Is your field a normal "file field" - or is it a Ram/Memory field?

Cheer
Bruce

Mark Sarson

  • Newbie
  • *
  • Posts: 33
    • View Profile
    • Email
Re: CheckBox not storing value
« Reply #2 on: May 16, 2011, 11:28:35 PM »
Hi Bruce,

Its a normal file.

Cheers

Mark

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: CheckBox not storing value
« Reply #3 on: May 17, 2011, 03:32:17 AM »
Hi Mark,

ok, this is a guess mind, but I suspect you're embedding a NetWebForm inside a NetWebForm - probably by using the xHtml tab, and setting it to be "after <form>" instead of "before <form>". This results in the "Save" button submitting the wrong "form" - which means the checkbox value is not being sent to the server at all.

As an aside, a good thing to know, is that empty checkboxes are not included in the POST from the browser to the server, only "true" checkboxes are sent as part of the POST statement. This is probably hampering your debugging effort.

cheers
Bruce