Copied to clipboard

Flag this post as spam?

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


  • Anders Smedman 9 posts 30 karma points
    Sep 08, 2016 @ 08:45
    Anders Smedman
    0

    Get current checked boxes in ContentService Saving event

    I have a doc type using the XML Checkbox Picker and I like get the checked boxes in my .ContentService Saving() event so I can resolve the names, add to comma seprated string and save it to a label.

    How can I accomplish this?

    When I try to get them as below in the .Saving() event I only get null values

    // .productCategory is a NuPicker: XML Checkbox Picker
    var productCategories = p.productCategory;
    
    // Loop products categories
    foreach (var item in productCategories.PickedKeys)
    {
      // get the Name for each item and add to string, but they are null?
    }
    
  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Dec 22, 2016 @ 18:07
    Hendy Racher
    0

    Hi Anders,

    Appreciate this is a late reply, but did you ever solve this ? (was it only on first save that they were null, how about the .Saved() event ?)

    Thanks, Hendy

  • Anders Smedman 9 posts 30 karma points
    Dec 23, 2016 @ 07:45
    Anders Smedman
    0

    Nope, I did not get it to work! I did realize that the .Saving() occurs before the checkboxes are recreated so I did a really ugly data type and added to that doc type, I do not remember exactly but some javascript that picked up changes on the checkboxes and then I stored them to a hidden input and did a ajax post to a custom api that updated a label with selected checbox ids/values... not pretty but it did work :)

Please Sign in or register to post replies

Write your reply to:

Draft