First of all please pardon me for my english.

I am implementing application in codignator. I want functionality like on multiple check box check/uncheck the value in database has to be updated.

Message :<input type="checkbox" class="Notification" name="Message"  value="1" checked="checked">
Message :<input type="checkbox" class="Notification" name="Call"  value="2" checked="checked">
Message :<input type="checkbox" class="Notification" name="Alert"  value="3" checked="checked">
<input type="submit" class="Notification" value="Submit">

now if i unchecked this checkbox than in database it should be update like

UPDATE `user_notifications`SET `istype` = '0' WHERE notification_id=1 Or
UPDATE `user_notifications`SET `istype` = '0' WHERE notification_id=2 Or
UPDATE `user_notifications`SET `istype` = '0' WHERE notification_id=3

If i check all the checkbox than in database it should be updated like

UPDATE `user_notifications`SET `istype` = '1' WHERE notification_id=1 Or
UPDATE `user_notifications`SET `istype` = '1' WHERE notification_id=2 Or
UPDATE `user_notifications`SET `istype` = '1' WHERE notification_id=3

In simple I have 3 notification_id and for each i assign one check box. so on particular checkbox check/uncheck update query must have to trigger

Please guide me how to do it with model view controller.

Related posts

Recent Viewed