Link to home
Start Free TrialLog in
Avatar of mikha
mikhaFlag for United States of America

asked on

asp.net mvc , views, hidden values ?

consider a scenario below. I have a MVC view, with months of the year listed and checkboxes for weeks in every month. if the users clicks on any checkboxes, i also want to be able to identify, for which month they selected the week for. in my database, i have columns for month and then week. I don't want another checkbox next to each month, for users to click.

so what is a good way to identify and send the month info as well to the controller so that , i can save the value for the month in the database.

do use hidden field for such scenario?

<div id="January">
   <input type="checkbox" name="week" value="1"/>
   <input type="checkbox" name="week" value="2"/>
</div>
<div id="February">
   <input type="checkbox" name="week" value="1"/>
   <input type="checkbox" name="week" value="2"/>
</div>
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mikha

ASKER

right.