0

I have custom slider module.

Within that module you can add items (slides) one by one ( with title, caption, aso.. ).

Now I added a checkbox to the same form.

Only one item (slide) should have that checkbox checked at the same time! I dont want to uncheck it on one item and check it on the next -> this should be automatic. So if I check that checkbox for an item it should remove the checked status in DB from the old one.

2
  • Can you be more clear please? I dont understand what the issue is.
    – mbalparda
    Jul 29 '14 at 12:48
  • edited, hope its better now ^^ Jul 29 '14 at 12:59
0

You will have to code your way out of this.

The code should check if the input has a value, load the entire collection, set the checkbox value to 0 in the entire collection, load the single slide where you want to enable the checkbox, set the field, save the object and then save the single element with the new checkbox.

Wth SQL, you can do a mass update without a where condition to avoid loading the entire collection with something like UPDATE SET table.checkbox="0";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.