i was working with html check box control and bind it with model data but when i run the program then i saw always false was passing as check box value whether it checked or not.
at last searching google i found a code snippet which show how to work with check box with model data.
see my html
<input id="IsApproved" type="checkbox" value="true" name="IsApproved">
<input type="hidden" value="false" name="IsApproved">
what i need to do to create a hidden field for check box with same name but check box value i need to set true and hidden field value i need to set false. it work but really i do not understand how it work?
i just like to know how true and false is passing to action method when check box is checked or not.
when check box is checked then check box data is passing but when not checked then hidden field data is passing....just do not understand the technique. i am new in MVC and i search google to understand how this is working but found none right result. so please some one tell me how true/false is passing when check box is checked or not.
Aucun commentaire:
Enregistrer un commentaire