title: Passing a jQuery value to MVC 3 Razor view html helper
body: <p>I have the following jQuery function embedded in an MVC Razor page:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          $("input[name=MultiListsetting]").change(function () {
              var valueString = "";
              $("input[name=MultiListsetting]:checked").each(
              function () {
                  valueString += this.id + ","
              }
              );
              var MultiValueListResult = valueString.slice(0, -1);
              alert(MultiValueListResult);
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>This outputs a string based on the id attribute of a series of checkboxes. When a checkbox value changes, the string gets rebuilt. So with 3 checkboxes, all checked, the function will output: "checkboxID1,checkboxID2,checkboxID3" until changed. This is the way our DB server stores values for this set of checkboxes. What I need to accomplish now is pass the string that this function outputs to a hidden HTML element on the same Razor page. </p>
  
  <pre><code>@Html.Hidden("SetViewModel[" + i + "].Value", [string output here])
  </code></pre>
  
  <p>Will jQuery allow this move? Can I somehow take "MultiValueListResult" and plop it into the hidden control? I'm still researching.</p>