Avatar of newjeep19
newjeep19Flag for United States of America asked on

Who to capture the date selected from a popcalendar to a text box

I have a popcalendar via javascript that select the date and then puts that date into a asp.net text box. I then at the bottom have another asp.net text box that is used to verify the selections made on the asp.net web page when the user clicks a button. However, the date in the asp.net textbox does not appear in the asp.net textbox used to verify the selection's. I have tried auto post back and still it does not capture the date when being verified.
SSRS

Avatar of undefined
Last Comment
Mike McCracken

8/22/2022 - Mon
ASKER
newjeep19

How to do I get the end date to be no greater than the 180 days (6 months )from the srart date.
Code:
        function datePickerClosed(dateField) {
            var dateObj = getFieldDate(dateField.value);
            var today = new Date();
            today = new Date(today.getFullYear(), today.getMonth(), today.getDate());
         
            if (dateField.name == "TextBox1") {
                if (dateObj < today) {
                    // if the date is before today, alert the user and display the datepicker again
                    alert("Please enter a date that is today or later");
                   //dateField.value = "";
                }
            }
Mike McCracken

I don't know about the Java datepicker.  I know in the VB datepicker I can set a min and max date before displaying it.  Also VB has a DATEADD that can add days to a date.  You could use something like that to compare the selected date to CurrentDate +180

mlmcc
ASKER
newjeep19

I am using C# as my code behind.
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
Mike McCracken

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question