简体   繁体   English

日历功能帮助使用jquery,ajax和php

[英]Calendar functionality help using jquery ,ajax and php

I have been trying hard to get the data from the clicked checkboxes using jquery but not able to get data of one variable. 我一直在努力使用jquery从单击的复选框中获取数据,但无法获取一个变量的数据。

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. 我想保存,例如,如果我单击2-3时间并且星期天是星期一,当我单击保存时间表时,它应该将这些值保存到数据库中,但是我没有在变量中获取时间值,但是我正在获取值当我在提交时提醒它的一天。

Check this link for getting clear idea. 检查此链接以获得清晰的主意。 calendar 日历

code

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. 它设置你的text变种,当你点击一个复选框,但是当你点击你的提交按钮,这也是一个input ,它覆盖text值。

Use the :not() selector, so that it does not bind your click function when the input is the select button 使用:not()选择器,以便当输入是选择按钮时它不会绑定您的点击功能

$('input:not(#submit)').click(function()

see this jsFiddle example, using :not(#submit) - http://jsfiddle.net/wBNGP/ 请参阅此jsFiddle示例,使用:not(#submit) : //jsfiddle.net/wBNGP/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM