Forums

Checkbox not updating in DB, Nd Help

ranjeev 19 Feb, 2009
I have a checkbox in comprofiler which the value I need to update using a CF registration form (tied to CB) as a user registers for the first time. I am able to store all the basic data and other fields but how is the checkbox value saved - no idea.

I have been trying for hours because I am new to PHP. Pls help, anyone.
GreyHead 19 Feb, 2009
Hi ranjeev,

They can be stored in different ways - sometimes 1 bit ( 0 or 1 ) sometimes yes or no, sometimes with a value or no value. What's the field format in the comprofiler table and what does stored info look like in the field?

Bob
ranjeev 20 Feb, 2009
HI Bob,

First of all both you and Max are amazing in response. I really appreciate this forum because of you guys.

My checkbox type is tinyint(3) which accepts 1/0 values. I've tried hidden fields with such values but I think it's passing as a string and thus not registering anything.

I used the form wizard code:
<div class="form_item"><div style="display: none;" class="form_element cf_hidden"><label class="cf_label">Hidden field</label><input value="1" id="hidden_0" name="hidden_0" type="hidden"></div><div class="clear"> </div></div>


I have only a single checkbox that needs to be stored to the field cb_cbox.
Max_admin 20 Feb, 2009
Hi ranjeev,

I just tried to create a simple form in the wizard then created a table through Chronoforms and choose TINYINT for the field type which results in a TINYINT(4) table field and all is working fine!

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
ranjeev 20 Feb, 2009
Thank you. Missed that simple thing.

*edit-
I agree it works on newly created forms & tables via CF. But my main idea is to put in the checkbox value during registration which is crucial. I used the cb registration plugin for that & my target field to update is cb_cbox.
Max_admin 20 Feb, 2009
I think that this may be the problem yes, because the cb_plugin inserts the data to the CB table in a different way, I have no solution for this now except by a new version of the cb_plugin! :?

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.