title: Binding multiple fields to the same property of an MVC 3 view model
body: <p>I am currently trying to figure out how you can bind multiple fields in an MVC 3 view to 1 
  property on a view model and what is recommended when trying to achieve this.</p>
  
  <p>Using an example for the number of minutes (only) that it takes to prepare something.</p>
  
  <p>The form might look something like this:</p>
  
  <p>Preparation time  - Hours: [ 1 ] Minutes: [ 30 ] </p>
  
  <p>and the submitted form values need to be converted into minutes and bound to the PreparationTimeInMinutes property of the ViewModel.</p>
  
  <p>ViewModel property:</p>
  
  <pre><code>public short PreparationTimeInMinutes { get; set; }
  </code></pre>
  
  <p>and the View is strongly typed to the ViewModel and currently has the below: </p>
  
  <pre><code>&lt;div class="editor-label"&gt;
      @Html.LabelFor(model =&gt; model.PreparationTimeInMinutes)
  &lt;/div&gt;
  &lt;div class="editor-field"&gt;
      @Html.EditorFor(model =&gt; model.PreparationTimeInMinutes)
      @Html.ValidationMessageFor(model =&gt; model.PreparationTimeInMinutes)
  &lt;/div&gt;
  </code></pre>
  
  <p>Here are a few things that I began thinking about in order to achieve this.</p>
  
  <ol>
  <li>Change the PreparationTimeInMinutes property to a ViewModel that has an hour &amp; minute
  property and create Editor and display templates  for it so that
  MVC3 can sort out the binding and validation?</li>
  <li>Use javascript and a hidden field for the preparation time.</li>
  <li>Some other approach that lets you use the MVC model binding to do this sort of thing?</li>
  </ol>
  
  <p>Does anyone have any suggestions on best practice for this sort of thing? or if I am way off.</p>
  
  <p>Please let me know. Thanks</p>