× If you expect answers you should describe your problem and give as much information's as possible. (SQL-Structure, Template Code, Joomla Version ...) Please read this before posting: joodb.feenders.de/support.html

Checkbox data entry

More
10 years 2 months ago #2732 by timmcleod
Checkbox data entry was created by timmcleod
Hi,

I'm new to your product (it looks great so far)

I'm writing an asset database and I need to have a field entitled "Active". I want this field to be a checkbox rather than text entry and I cannot find anything on the site that explains how you do this.

Can you let me know how this is done?

Thanks

Tim

Please Log in to join the conversation.

More
10 years 2 months ago - 10 years 2 months ago #2734 by Dirk
Replied by Dirk on topic Checkbox data entry

timmcleod wrote: I'm writing an asset database and I need to have a field entitled "Active". I want this field to be a checkbox rather than text entry and I cannot find anything on the site that explains how you do this.


The problem is Joodb can not automatically detect the type of a field. Therefore even tinyint-fields are normal input buttons.

But you have several options.

* Change your active field to a SET type with values like (0,1) or (active,inactive,trashed)

* Alternatively you can also insert the code by hand into the form template
<label><input type="radio" name="afield" value="0" /> Inactive</label>
<label><input type="radio" name="afield" value="1" {joodb ifis|afield}checked="checked"{joodb endif} /> Active</label>

* Alternatively you can write yourself a plugin which outputs the code

Be aware that normal checkboxes will not do the job, because joodb does not overwrite the value of a field if it's not posted.
Last edit: 10 years 2 months ago by Dirk.
The following user(s) said Thank You: avguru

Please Log in to join the conversation.

Moderators: Dirkjoest