Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Evan Harper 15 posts 37 karma points
    Nov 28, 2012 @ 19:50
    Evan Harper
    0

    Patch to allow CheckBoxLists to work rightly

    Hello,

    I needed to use RestContour to submit a form with a checkboxlist which can have multiple values, which wasn't working quite right, because RestContour out of the box will only submit a single string per record field. So at line 129 in SubmitContourForm.cs I added:

    if (recordField.Field.FieldType is Umbraco.Forms.Core.Providers.FieldTypes.CheckBoxList)
      recordField.Values = new List<Object>((recordField.Values[0] as String).Split(','));

    And now I can submit comma-separated lists of checkbox GUIDs which will be interpreted correctly. Maybe it will be useful for someone else.

    Evan Harper

Please Sign in or register to post replies

Write your reply to:

Draft