jquery - fullcalendar process checkbox in a modal -


i'm using fullcalendar in rails app. have modal entering data event. 1 field overtime boolean.

html:

<input type="checkbox" name="overtime" id="overtime" value="" class="text ui-widget-content ui-corner-all" /> 

the following code doesn't work - calendar doesn't show:

select: (start, end, allday) ->   title = $("#title")   description = $("#description")   hours = $("#hours")   overtime = $("#overtime")   workorder = $("#workorder_id")   actcode = $("#actcode_id")   $("#dialog-form").dialog     autoopen: true     height: 500     width: 400     modal: true     buttons:      "create labor": ->        $.create "/events/",          event:            workorder_id: workorder.val(),            actcode_id: actcode.val(),            title: title.val(),            description: description.val(),            hours: hours.val()            starts_at: "" + start,            ends_at: "" + end,            all_day: allday,            maxsynch: "n",            employee_id: $('#calendar').data('employeeid')            if $("#overtime").attr "checked"              overtime: "true"        $(this).dialog "close"        $('#calendar').fullcalendar('refetchevents')        cancel: ->         $(this).dialog "close" 

this code doesn't work:

$("#overtime").attr "checked"  overtime: "true" 

i tried:

overtime: "true" if $("#overtime").attr "checked" 

if don't have test , use `overtime: "true" - set boolean true in db.

i tried this:

overtime: "true" if $("#overtime").checked 

i don't think it's finding overtime in html?

the following works in browsers i've tested except ie

overtime: "true" if overtime.checked 

use true instead:

$("#overtime").attr "checked" ->              overtime: true 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -