How to disable a update button in the jquery dialog -


this full calendar.when cick full calendar in particular event dialog screen open.

this script:

 var date = new date();     var d = date.getdate();     var m = date.getmonth();     var y = date.getfullyear();      var calendar = $('#calendar').fullcalendar({         theme: true,         header: {             left: 'prev,next today',             center: 'title',             right: 'month,agendaweek,agendaday'         },          eventclick: updateevent,         selectable: true,         selecthelper: true,         select: selectdate,         editable: true,         events: "jsonresponse.ashx",         eventdrop: eventdropped,         eventresize: eventresized,         eventrender: function(event, element) {             //alert(event.title);             element.qtip({                 content: event.projectdescription,                 position: { corner: { tooltip: 'bottomleft', target: 'topright'} },                 style: {                     border: {                         width: 1,                         radius: 3,                         color: '#2779aa'                      },                     padding: 10,                     textalign: 'center',                     tip: true, // give speech bubble tip automatic corner detection                     name: 'cream' // style according preset 'cream' style                 }              });         }      });  }); 

when evnt clicked "update event" function called in dialog opened in have update button in secanrio want disable it.

var currentupdateevent; var addstartdate; var addenddate; var globalallday;  function updateevent(event, element) {     //alert(event.description);      if ($(this).data("qtip")) $(this).qtip("destroy");      currentupdateevent = event;      $('#updatedialog').dialog('open');     $("#eventid").val(event.id);     $("#lblprjnumber").text(event.projectnumber);     $("#lblprjname").text(event.projectname );     $("#lblprjdesc").text(event.projectdescription);     $("#lblmonday").val( event.monday);     $("#lbltuesday").val(event.tuesday);     $("#lblwednesday").val(event.wednesday);     $("#lblthursday").val(event.thursday );     $("#lblfriday").val(event.friday);     $("#lblsaturday").val(event.saturday);     $("#lblsunday").val( event.sunday);       $("#eventstart").text("" + event.start.tolocalestring());      if (event.end === null) {         $("#eventend").text("");     }     else {         $("#eventend").text("" + event.end.tolocalestring());     }  } 

for ref posting "update dialog also"

$(document).ready(function() {      // update dialog     $('#updatedialog').dialog({         autoopen: false,         width: 470,          buttons: {             "update": function(evt)              {                                //alert(currentupdateevent.title);                 var eventtoupdate = {                     id : currentupdateevent.id,                     projectnumber : $("#lblprjnumber").text(),                     projectname : $("#lblprjname").text(),                     projectdescription : $("#lblprjdesc").val(),                     monday : $("#lblmonday").val(),                     tuesday : $("#lbltuesday").val(),                     wednesday : $("#lblwednesday").val(),                     thursday : $("#lblthursday").val(),                     friday : $("#lblfriday").val(),                     saturday : $("#lblsaturday").val(),                     sunday : $("#lblsunday").val()                  };                  if (checkforspecialchars(eventtoupdate.title) || checkforspecialchars(eventtoupdate.description)) {                     alert("please enter characters: z, z, 0 9, spaces");                 }                 else {                     pagemethods.updateevent(eventtoupdate, updatesuccess);                     $(this).dialog("close");                     currentupdateevent.projectnumber = $("#lblprjnumber").val();                     currentupdateevent.projectname = $("#lblprjname").val();                     currentupdateevent.projectdescription = $("#lblprjdesc").val();                     currentupdateevent.monday = $("#lblmonday").val();                     currentupdateevent.tuesday = $("#lbltuesday").val();                     currentupdateevent.wednesday = $("#lblwednesday").val();                     currentupdateevent.thursday = $("#lblthursday").val();                     currentupdateevent.friday = $("#lblfriday").val();                     currentupdateevent.saturday = $("#lblsaturday").val();                     currentupdateevent.sunday = $("#lblsunday").val();                      $('#calendar').fullcalendar('updateevent', currentupdateevent);                   }              }           }      }); 

this disable button given id:

$("#"+id).button("disable"); 

please replace id variable holds button id


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -