jquery - Why if clicking print button first time its getting null values second time its getting exact value -
why if clicking print button first time getting null values second time getting exact value using jquery
below code funtion please this.
function prevschdcreateid() { $("#tblprevschdcreatejobcardmaster a").click(function () { alert("print"); job_card_no = this.id; if ($(this).text() == "print") { $("#divmain").hide(); $("#dvprevschdprintdetails").show(); getmthstmt_chklist_workpermit_resources(this.id); print("dvprevschdprintdetails", "preventive maintenance"); $("#divmain").show(); $("#dvprevschdprintdetails").hide(); } else { $("#dvprevschdprintdetails").css("dispaly", "none"); } }); }
$("#tblprevschdcreatejobcardmaster a").click(function () { alert("print"); job_card_no = this.id; if ($(this).text() == "print") { $("#divmain").hide(); $("#dvprevschdprintdetails").show(); getmthstmt_chklist_workpermit_resources(this.id); print("dvprevschdprintdetails", "preventive maintenance"); $("#divmain").show(); $("#dvprevschdprintdetails").hide(); } else { $("#dvprevschdprintdetails").css("display", "none"); } });
just use this.. without enclosing function.
Comments
Post a Comment