We have a Data extension (DE) where our users will have used checkboxes to select one or more items relating to a specific field. While the form Posts the data correctly and saves the multiple selections to the data extension as expected, the challenge is reviewing the selection and correctly checking the correct boxes when it displays. So this:
<input type="checkbox" name="Brand" value="Solution1" %%[ IF v(@Brand) == "Solution1," THEN ]%%checked%%[ ENDIF ]%%/>Solution1 <input type="checkbox" name="Brand" value="Solution2" %%[ IF v(@Brand) == "Solution2," THEN ]%%checked%%[ ENDIF ]%%/>Solution2 <input type="checkbox" name="Brand" value="Solution3" %%[ IF v(@Brand) == "Solution3," THEN ]%%checked%%[ ENDIF ]%%/>Solution3 <input type="checkbox" name="Brand" value="Solution4" %%[ IF v(@Brand) == "Solution4," THEN ]%%checked%%[ ENDIF ]%%/>Solution4
Will correctly save to the DE whichever "solutions" are selected, but when reading back in, it's not displaying correctly. A flaw of the logic might be that it needs to be asking for "contains" rather than == but I detect some issues with that perhaps confusing a smaller string within a larger one (ie. 12345 contains 345 but doesn't match) I've worked with PHP scripts that require 's following each item to post an array but that is also different from getting the info.
When one checks two items (ie. 1 and 3) the system, by default, sets the field value to
thus the IF statement above will be incorrect even if "solution1" is one of the fields values.
UPDATE The multiple checkboxes set up the comma delimited string in the related DE field. Additional scripting is required to parse through this and it's been suggested that we implement the BuildRowsetFromString() (BRSFS) function to loop through that set. My first take was an attempt to see the returned value of BRSFS when it parses through the applicable DE field. Using v(@fieldRS) though is not returning a visible value to display on the page. I understand that the script will now need to loop and parse through the field as an array to confirm the checked setting for the any number of checkboxes. Any suggestions on usage or detailing are welcome.