Page 1 of 1
Help with checbox
Posted: Sun Aug 25, 2013 2:59 pm
by tsalmeida
Hi guys
I have a website with product evaluation with positive and negative points in checkbox. The points are the same.
must do the following:
The User selects the positive "durability" however after scoring the User decides "durability" as a negative point. need, when selecting the negative field the positive field is automatically cleared.
How can I do this?
Re: Help with checbox
Posted: Sun Aug 25, 2013 5:28 pm
by Christopher
Make them radio buttons instead of checkboxes.
Re: Help with checbox
Posted: Mon Aug 26, 2013 10:54 am
by tsalmeida
hmm
how can I insert in db several radio buttons in the same column?
Re: Help with checbox
Posted: Mon Aug 26, 2013 11:45 am
by Celauran
Why would you want to do that? What are you trying to accomplish?
Re: Help with checbox
Posted: Mon Aug 26, 2013 12:39 pm
by tsalmeida
need to save the evaluation made by each User for a particular product.
with checkbox I managed to write all correctly marked items, however if you select the same item with positive and negative will record the same way
Re: Help with checbox
Posted: Mon Aug 26, 2013 12:43 pm
by Celauran
Sounds like you might be better off using a join table (user_id, product_id, rating).
Re: Help with checbox
Posted: Mon Aug 26, 2013 4:24 pm
by Christopher
tsalmeida wrote:need to save the evaluation made by each User for a particular product.
with checkbox I managed to write all correctly marked items, however if you select the same item with positive and negative will record the same way
How you save it depends on whether/how you need to query the data later.
You can save all choices in a single record:
[text]eval_id choices
42 1,2,3,4[/text]
Or each choice as an individual record
[text]id eval_id choices
88 42 1
89 42 2
90 42 3
91 42 4[/text]
Re: Help with checbox
Posted: Sat Aug 31, 2013 1:52 pm
by tsalmeida
thanks for help