james henderson
asked on
jsDatePick
how can I fire an event after jsDatePick places a value in the assigned textbox control? the delegation example on their site does not work! Any help appreciated.
the onchange event of the textbox doesn't fire after you assign a value to it?
ASKER
the only event that fires on the textbox is the onBlur event, which won't work because then I have to select the date from the calendar twice.
Hi,
could you perhaps post your existing source and scripts (or a link if the page is available from the internet) as the delegate should work?
Thanks and HTH
Rainer
could you perhaps post your existing source and scripts (or a link if the page is available from the internet) as the delegate should work?
Thanks and HTH
Rainer
ASKER
here is the javascript example jsDatePick has posted on their website:
g_calendarObject = new JsDatePick({
useMode:1,
isStripped:true,
target:"aFieldId",
cellColorScheme:"armygreen "
});
g_calendarObject.setOnSele ctedDelega te(functio n(){
var obj = g_calendarObject.getSelect edDay();
alert("a date was just selected and the date is : " + obj.day + "/" + obj.month + "/" + obj.year);
});
the script never reaches the delegate function, it errors on setting the object to a new calendar.
I need the delegate function to do a post (rather than an alert).
g_calendarObject = new JsDatePick({
useMode:1,
isStripped:true,
target:"aFieldId",
cellColorScheme:"armygreen
});
g_calendarObject.setOnSele
var obj = g_calendarObject.getSelect
alert("a date was just selected and the date is : " + obj.day + "/" + obj.month + "/" + obj.year);
});
the script never reaches the delegate function, it errors on setting the object to a new calendar.
I need the delegate function to do a post (rather than an alert).
Hi,
as the code works an their sample page, it could be that the error is from somewhere else on your page, therefore I asked if you can post your current code, to run a deeper analysis on it.
Thanks
as the code works an their sample page, it could be that the error is from somewhere else on your page, therefore I asked if you can post your current code, to run a deeper analysis on it.
Thanks
ASKER
code is below. please note that the first two calendar objects work perfectly. the third one causes error when trying to create. I need to delegate for an event to post the value of the selected date.
<script src="http://prdweb01/TargetManagementMiscLibrary/jquery_datepicker/jsDatePick.min.1.3.js" type="text/javascript"></s cript>
<script type="text/javascript">
window.onload = function () {
new JsDatePick({ useMode: 2, target: "txtDateSCB", dateFormat: "%m/%d/%Y" });
var showConsumer = "<%=mShowConsumer %>";
if (showConsumer == "Y") {
new JsDatePick({ useMode: 2, target: "txtDatRefillDate", dateFormat: "%m/%d/%Y" });
new JsDatePick({ useMode: 2, target: "txtDatDoctorSchedule", dateFormat: "%m/%d/%Y" });
g_calendarObject = new JsDatePick({
useMode:1,
isStripped:true,
target:"txtDatePlanToFillR x",
cellColorScheme:"armygreen "
});
g_calendarObject.setOnSele ctedDelega te(functio n(){
var obj = g_calendarObject.getSelect edDay();
alert("a date was just selected and the date is : " + obj.day + "/" + obj.month + "/" + obj.year);
});
}
};
</script>
<script src="http://prdweb01/TargetManagementMiscLibrary/jquery_datepicker/jsDatePick.min.1.3.js" type="text/javascript"></s
<script type="text/javascript">
window.onload = function () {
new JsDatePick({ useMode: 2, target: "txtDateSCB", dateFormat: "%m/%d/%Y" });
var showConsumer = "<%=mShowConsumer %>";
if (showConsumer == "Y") {
new JsDatePick({ useMode: 2, target: "txtDatRefillDate", dateFormat: "%m/%d/%Y" });
new JsDatePick({ useMode: 2, target: "txtDatDoctorSchedule", dateFormat: "%m/%d/%Y" });
g_calendarObject = new JsDatePick({
useMode:1,
isStripped:true,
target:"txtDatePlanToFillR
cellColorScheme:"armygreen
});
g_calendarObject.setOnSele
var obj = g_calendarObject.getSelect
alert("a date was just selected and the date is : " + obj.day + "/" + obj.month + "/" + obj.year);
});
}
};
</script>
Hi,
I have tried to create a sample on jsbin based on your provided part of the code:
http://jsbin.com/atuqun/6/
I assume that the control with the id "txtDatePlanToFillRx" is a input box type text, but the global object must be bound to a div and then you can set the value afterwards to the textbox.
HTH
Rainer
I have tried to create a sample on jsbin based on your provided part of the code:
http://jsbin.com/atuqun/6/
I assume that the control with the id "txtDatePlanToFillRx" is a input box type text, but the global object must be bound to a div and then you can set the value afterwards to the textbox.
HTH
Rainer
ASKER
actually, it's a <asp:textbox> but works the same. I tried your code and it still errors when trying to set the global object to a <div>. I know I'm missing something ...
ASKER
I do have this at the top of the page:
<%@ Register Assembly="AjaxControlToolk it" Namespace="AjaxControlTool kit" TagPrefix="asp" %>
<%@ Register Assembly="AjaxControlToolk
ASKER
i'm closing this question since no help was available.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.