I need to allow the user to check only one checkbox from more than five checkboxes.The checkboxes having the same name and diffrerent values.I need to store these values and retrive from database.Whether Jquery allow us to this feature? I am a newbie...Thanks in advance..
views:
233answers:
3
+1
A:
use radiobuttons.
http://www.w3schools.com/html/html%5Fforms.asp --> scroll down to Radio Buttons
Natrium
2009-10-28 07:47:06
Thanks for your comments both of you.But I adviced to use the checkbox only.Please help me in the means of checkboxes....Thanks in advance...
vinothkumar
2009-10-28 08:00:26
the one who adviced you that gave you bad advice
Natrium
2009-10-28 09:00:47
+1
A:
Better to use radio buttons in this case. They are meant to serve this purpose. Selecting only an item from this case.
If checkbox is a strict requirement then you can do this with jQuery. You have to unselect all the checboxes first and then check the one which is clicked.
rahul
2009-10-28 07:49:07
A:
When you dont wont radio buttons here is a jquery solution:
var checkboxes = $(':checkbox.myCheckboxGroup');
checkboxes.click(function(){
var self = this;
checkboxes.each(function(){
if(this!=self) this.checked = ''
})
})
eskimoblood
2009-10-28 08:07:49