Sorry I could not find the appropriate title
Here is my problem
I am using a method which returns a string value like hh:mm(12:45) this method is named as DeliveryTimeCalc()
I am using a jQuery timepicker to take input on my aspx page this timepicker has to be validated by mintime the minimum time should be the value returned by the method DeliveryTimeCalc() this serverside method has to be called during the jQuery is initialized so I did the below method
<script type="text/javascript">
$(document).ready(function () {
//window.onload = pageMethodConcept.callServerSideMethod;
var time = pageMethodConcept.callServerSideMethod;
alert(time);
var hm = time.split(':');
var h = hm[0]; var m = hm[1];
$("#tb_DeliveryTime").timepicker({ showPeriodLabels: false,
onHourShow: OnHourShowCallback,
onMinuteShow: OnMinuteShowCallback
});
function OnHourShowCallback(hour) {
if ((hour < h)) {
return false; // not valid
}
return true; // valid
}
function OnMinuteShowCallback(hour, minute) {
if ((hour == h) && (minute <= m)) { return false; } // not valid
return true; // valid
}
});
</script>
<script language="javascript" type="text/javascript">
pageMethodConcept = {
callServerSideMethod: function () {
PageMethods.DeliveryTimeCalc(pageMethodConcept.callback);
},
callback: function (result) {
alert(result);
//return result;
}
}
//window.onload = pageMethodConcept.callServerSideMethod;
</script>
but the problem is that it is not returning the value (hh:mm) I am getting a alert box which contains output like
function () {
PageMethods.DeliveryTimeCalc(pageMethodConcept.callback);
}
even if I use return I am getting the same value
but if I use
window.onload = pageMethodConcept.callServerSideMethod;
I am getting a alert box which contains output like hh:mm
Please Help!
language="javascript"is obsolete and not necessary.