LelloLello
asked on
is there a way i can show in my form that a checkbox is checked according to the entry in my sql table field.
Please see attached image before you read my question.
There is a SQL Database has this type of field.
Column Name: CMTEE_PREF and the Data Type varchar 25
I did a Coldfusion query and i'm able to retreive data in that data field. Data was
POL,SOP,EE,TF
Now I have a form with 4 checkbox, one for POL, SOP, EE, and TF.
Is there a way, that a checkbox can be clicked if the pol, sop, ee or TF was entered in the table. I would like to show that the checkbox is clicked if POL, SOP, or EE, or TF was in my CMTEE_PREF field ? Any way i can do that ?
This is my form code:
.......
This is your database results: <cfoutput><input type="text" name="CMTEE_PREF" value="#DisplayCVITool.CMT EE_PREF#" style="width: 200px;background:red;"></c foutput><b r>
<input type="checkbox" name="CMTEE_PREF" id="CMTEE_PREF1" value="POL"> <label>P olicy setting committees (POL)</label><br>
<input type="checkbox" name="CMTEE_PREF" id="CMTEE_PREF2" value="SOP"> <label>S tandard of practice setting committees (SOP)</label><br>
<input type="checkbox" name="CMTEE_PREF" id="CMTEE_PREF3" value="EEP"> <label>C ommittees related to education and eligibility issues <em>(EE)</em></label><br>
<input type="checkbox" name="CMTEE_PREF" id="CMTEE_PREF4" value="ADMIN"> <label >Administr ative committees such as Finance or Elections <em>(ADMIN)</em></label><b r>
<input type="checkbox" name="CMTEE_PREF" id="CMTEE_PREF5" value="TF"> <label>Ta sk Forces (typically short term commitment) <em>(TF)</em></label><br>
<input type="checkbox" name="CMTEE_PREF" id="CMTEE_PREF6" value="ANY"> <label>D oesn’t matter, I just want to volunteer. <em>(ANY)</em></label>
SQL-Table.jpg
CMTEE-PREF.jpg
There is a SQL Database has this type of field.
Column Name: CMTEE_PREF and the Data Type varchar 25
I did a Coldfusion query and i'm able to retreive data in that data field. Data was
POL,SOP,EE,TF
Now I have a form with 4 checkbox, one for POL, SOP, EE, and TF.
Is there a way, that a checkbox can be clicked if the pol, sop, ee or TF was entered in the table. I would like to show that the checkbox is clicked if POL, SOP, or EE, or TF was in my CMTEE_PREF field ? Any way i can do that ?
This is my form code:
.......
This is your database results: <cfoutput><input type="text" name="CMTEE_PREF" value="#DisplayCVITool.CMT
<input type="checkbox" name="CMTEE_PREF" id="CMTEE_PREF1" value="POL"> <label>P
<input type="checkbox" name="CMTEE_PREF" id="CMTEE_PREF2" value="SOP"> <label>S
<input type="checkbox" name="CMTEE_PREF" id="CMTEE_PREF3" value="EEP"> <label>C
<input type="checkbox" name="CMTEE_PREF" id="CMTEE_PREF4" value="ADMIN"> <label
<input type="checkbox" name="CMTEE_PREF" id="CMTEE_PREF5" value="TF"> <label>Ta
<input type="checkbox" name="CMTEE_PREF" id="CMTEE_PREF6" value="ANY"> <label>D
SQL-Table.jpg
CMTEE-PREF.jpg
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Excellent... Do you know i've still have a problem with a question it's a radio button... if i don't select yes or no i'm getting an error i wil post this new question please advice.
ASKER
Super!
ASKER
Ajax are u able to assist me pls https://www.experts-exchange.com/questions/27659226/SELECT-id-topic-eng-topic-fr-What-is-the-complete-url.html
I am not sure about JAVA, but in most of the languages, you can "split" the string in an array with a delimeter and then run the LOOP to check what all you need to mark "Checked".
If you want that your SQL Data should come in any different format (which helps you to mark check) then let us know the format.