• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFIF for check boxes being inserted in the database field car_make.

New Here ,
Jun 19, 2007 Jun 19, 2007

Copy link to clipboard

Copied

Hello i need help on CFIF for check boxes being inserted in the database field car_make.

At this point multiple values is inserted in the field car_make. i wish to have only one value depending on what is checked in the check box.

Thanks

here is what i mean. let me know if it is not clear.

Cfif
if Honda is checked then Honda value is inserted in the field car_Make

If if Toyota is checked then Toyota value is inserted in the field car_Make


If if Subaru is checked then Subaru value is inserted in the field car_Make


TOPICS
Advanced techniques

Views

376

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advocate , Jun 21, 2007 Jun 21, 2007
You certainly CAN, but not without being comfortable working in javascript. Is there a particular reason you want to use checkboxes as opposed to radio buttons?

From an interface standpoint, its usually not a good idea to change the expected behaviour of HTML form elements. If users see a radio button, they usually assume that it will allow only 1 choice. If they are presented with a checkbox, they could very easily expect that they could select more than 1.

Votes

Translate

Translate
Advocate ,
Jun 19, 2007 Jun 19, 2007

Copy link to clipboard

Copied

It sounds like you want a radio button instead of a checkbox. Checkboxes allow you multiple selections for a give form field, radio buttons require that you only select 1 from a set number of options.

Change
input type="checkbox"
To
input type="radio"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 20, 2007 Jun 20, 2007

Copy link to clipboard

Copied

thanks

but can i also make a checkbox exclusive.
if and only one is checked then action?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 21, 2007 Jun 21, 2007

Copy link to clipboard

Copied

LATEST
You certainly CAN, but not without being comfortable working in javascript. Is there a particular reason you want to use checkboxes as opposed to radio buttons?

From an interface standpoint, its usually not a good idea to change the expected behaviour of HTML form elements. If users see a radio button, they usually assume that it will allow only 1 choice. If they are presented with a checkbox, they could very easily expect that they could select more than 1.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation