Solved

jsDatePick

Posted on 2013-05-20
11
1,663 Views
Last Modified: 2013-06-05
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.
0
Comment
Question by:dhenderson12
  • 6
  • 4
11 Comments
 
LVL 33

Expert Comment

by:Big Monty
ID: 39182234
the onchange event of the textbox doesn't fire after you assign a value to it?
0
 

Author Comment

by:dhenderson12
ID: 39182360
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.
0
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 39182481
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
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:dhenderson12
ID: 39182610
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.setOnSelectedDelegate(function(){
        var obj = g_calendarObject.getSelectedDay();
        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).
0
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 39182675
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
0
 

Author Comment

by:dhenderson12
ID: 39199743
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"></script>
   
    <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:"txtDatePlanToFillRx",
        cellColorScheme:"armygreen"
    });
   
    g_calendarObject.setOnSelectedDelegate(function(){
        var obj = g_calendarObject.getSelectedDay();
   
        alert("a date was just selected and the date is : " + obj.day + "/" + obj.month + "/" + obj.year);
    });
               
            }


        };
    </script>
0
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 39200838
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
0
 

Author Comment

by:dhenderson12
ID: 39205698
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 ...
0
 

Author Comment

by:dhenderson12
ID: 39208704
I do have this at the top of the page:
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
0
 

Author Comment

by:dhenderson12
ID: 39214377
i'm closing this question since no help was available.
0
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 500 total points
ID: 39221756
Hi,
as both the site of the jsPick owner as well as the provided code on jsbin works, it is related to the created HTML output.
What error do you get?
Could you please attach the produced HTML output so that we can help to solve?
Thanks.
Rainer
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
asp Google Map 2 33
Phone Does Not Abide By CSS Breakpoint For Navigation Controls 6 22
on window close, not beforeunload 6 20
using CK editor in iframes 5 18
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question