Click here to Skip to main content
15,899,474 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi everyone,

I'm building a web app and i use HTML.CheckboxFor in HTML.Helper and named field IsSpecial and allow null.
When I checked on checkbox, it did not get value of checkbox control, I debug and I see its value (IsSpecial) = null.

How can I do ?
Thank everyone very much.
Posted

normally if checkbox is unchecked that control does not pass in html so you have to validate that one inside your server side script
 
Share this answer
 
Comments
CuongPuyol 7-Aug-14 3:22am    
wow....so, how can i do....you can detail it
thanks Thilina Chandima very much
Thilina Chandima 7-Aug-14 5:14am    
what server side language u going to use as your back end
if you going to use php you can validate like this.

PHP
if(isset($_POST['vtype'])){
   //do what you want to do 
}
 
Share this answer
 
v2
Comments
CuongPuyol 7-Aug-14 11:40am    
I'm using asp.net mvc....thank Thilina Chandima very much
Thilina Chandima 7-Aug-14 23:17pm    
you are welcome
Many Thanks......have a nice day ;)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900