Checkbox "Invalid Data" when selecting more than one

If I check more than one item from a Checkbox, I get the error “Invalid Data.” If I select just one, it works fine. This is from a project that was imported from ScriptCase 7 to ScriptCase 8 and previously worked.

Thanks!!

new-2.jpg

screen1.jpg

TechGuy,

If I understand what you want to accomplish, it would appear to me that you have a single field, that you have designated as multiple checkboxs. This configuration would make sense for a set of radio buttons or a select (popup menu) where you can select one item only, and the “conditions” field would then be assigned the value of the “id” field from the “conditions” record represented by the radio button or popup menu.

If you want to have multiple checkboxs, and want to allow a single record to have multiple checkboxes checked, you would need to do one of two things:

  1. Set up a N-N relationship with an intermediate file.
    or
  2. Create a field in the database for each checkbox

Or maybe I don’t understand what you are trying to do.

Hope this helps,

Dave

Thanks for the reply!

I don’t understand what you mean by #1 – what is an intermediate file?

Creating a new table or dozens of fields for an N-N relationship seems overkill, especially when it could be accomplished with only a varchar column in the previous version… Every PHP program I’ve ever written stores multiple checkboxes within a single field using either binary or CSV.

If I do need to make such a change, is there some simple way to have the dozens of checkboxes created automatically in the form, rather than building each one by hand? (The table that contains the list of options is user-editable.)

For anyone discovering this thread, I thought I’d post an update. I paid for a support ticket from Scriptcase and received the response:

“it’s a bug that already was reported to our team development, when solved we’ll include the correction in next update release. thanks for your observation.”

I’m so glad that I paid for the support ticket to find that out. Ugh. :rolleyes:

I meant a table with two columns, whose records establish the N-N relationship between records in two other tables.

If you were to use a varchar (or any field where you represent a checkbox by a single bit) then you would not be able to reorder or add/remove checkboxes without invalidating all of your existing data. The idea of N-N relationships is to be able to modify data in either table without introducing data inconsistency. Normally, in SQL you use Constraints with Modify/Cascade and Delete/Cascade to ensure that the intermediary table stays consistent.

Yes, in fact using the N-N feature in scriptcase populates the checkboxes on the form automatically for you. It is fully dynamic, so when somebody adds to, deletes from, or reorders the records in the options table, the checkboxes will be updated next time the form is loaded - without re-generating code.

You would definately not want to manually create each checkbox on the form.

You should check out this link: http://www.scriptcase.net/blog/n-to-n-relationship-on-scriptcase/

Dave