Skip to main content

Counting selections wihtin Checkbox Select List input control

Comments

1 comment

  • Official comment
    Natan Cohen

    Hi Kurtis,

    There are a couple ways to do this.  First question to ask is whether you need to know this number before you ask the server to process/rebuild the report.  If yes, then you'll want to use an Action.PreActionJavascript just below your default Action element for the InputCheckboxList.  You can write some client-side JS to figure out how many items are checked and I'd strongly recommend jQuery to make this easier.  To use the count server-side in an @Request token, just use an InputHidden and set its value in your custom JS.

    If you don't need to know how many selections were made before you make a trip back to the server, then perhaps it's easier to parse the @Request token in a custom script server-side.  InputCheckboxList should return a comma-delimited list of values selected and you could simply load this into a JS array and get a count.  Hope that helps.

    Natan
    Logi Support

Please sign in to leave a comment.