I have been trying hard to get the data from the clicked checkboxes using jquery but not able to get data of one variable.
I want to save like for example if i click on 2-3 time and day is monday and when i click on save time sheet it should save these values into database but i am not getting value of time in variable ,but i am getting value of day when i alert it on submit.
Check this link for getting clear idea. calendar
Your issue is this line
$('input').click(function()
It sets your text
var when you click on a checkbox, but when you click on your submit button, which is also an input
, it overwrites the text
value.
Use the :not()
selector, so that it does not bind your click function when the input is the select button
$('input:not(#submit)').click(function()
see this jsFiddle example, using :not(#submit)
- http://jsfiddle.net/wBNGP/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.