Solved

doPost after textbox change

Posted on 2013-05-17
8
323 Views
Last Modified: 2013-06-02
I am using jsDatePick calendar control to select a date into an asp:textbox control.  I need to do a post after the calendar writes the selected date value to the textbox; select the date then do the postback.  Any help appreciated.
0
Comment
Question by:dhenderson12
  • 4
  • 4
8 Comments
 
LVL 39

Expert Comment

by:Kyle Abrahams
ID: 39175030
http://javascriptcalendar.org/javascript-date-picker.php


Example 3:
    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);
    });
   

just use a __DoPostback:
http://aspalliance.com/895_Understanding_the_JavaScript___doPostBack_Function.2
0
 

Author Comment

by:dhenderson12
ID: 39175402
thx for the reply.  it's throwing an error: "unexpected method or property access" and it occurs on the creating the calendar object.
0
 
LVL 39

Expert Comment

by:Kyle Abrahams
ID: 39175597
this was just for example purposes.

How are you creating your calendar?   Also are you using the latest version of the script?
0
 

Author Comment

by:dhenderson12
ID: 39177434
i create the calendar just like the example.  if the example is incorrect how should I be doing it?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 39

Expert Comment

by:Kyle Abrahams
ID: 39181730
Without seeing your code I can't see if it's done correctly or if something else is going on.
0
 

Author Comment

by:dhenderson12
ID: 39192628
here's the code:

<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>

the first two jdDatePick calendars work perfectly.  the one that is set up from their example is the one that fails when trying to create it.
0
 
LVL 39

Accepted Solution

by:
Kyle Abrahams earned 500 total points
ID: 39211181
when you view the source from the browser does txtDatePlanToFillRx actually exist?

What happens if you use mode 2 instead of 1?
0
 

Author Comment

by:dhenderson12
ID: 39214375
it doesn't work with mode 1 either.  i'm giving up on this, but you get the points for trying to help.  thx.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now