Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8011151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:56:45+00:00 2026-06-04T18:56:45+00:00

I have a javascript function in which if a user select future date then

  • 0

I have a javascript function in which if a user select future date then a pop up will appear and that pop up will contain an text box and a button.The user enter the value in the text box and click on the Button of child pop up.I want to capture those value in the parent window but i m not able to do it.

Below is the javascript which i had written:-

 function CheckDateEalier(sender, args)
     {
        var toDate = new Date();
        toDate.setMinutes(0);
        toDate.setSeconds(0);
        toDate.setHours(0);
        toDate.setMilliseconds(0);
        if (sender._selectedDate < toDate)
         {
            alert("You can't select day earlier than today! In Case if you are selecting Previous date then, By default it will take current Date.");
            sender._selectedDate = toDate;
            //set the date back to the current date
            sender._textbox.set_Value(sender._selectedDate.format(sender._format))
        }
        if (sender._selectedDate > toDate) {
            var timeSpent = window.open("EnterTimeSpent.aspx", "List", "scrollbars=no,resizable=no,width=320,height=100");
            document.getElementById('<%= hiddenFieldFutureDateSelectTimeSpent.ClientID%>').value = timeSpent;
        }
    }

javascript on Child page:-

<script language="javascript" type="text/javascript">
function Parent() {
    var timespent = Input.elements["timespent"].value; 
    //window.opener.UpdateValues(3);
    window.returnValue = timespent;
    self.close();
}

Child Page Code Behind:-

<form name="Input" method="post" action="">
     <table>
       <tr>
       <td><input type="text" name="timespent" style="font-size:small;font-weight:bold;"></input>
       </tr>
       <tr>
       <td>
       <input type="button" value="Submit"  class="button small green rounded"   onClick="Parent()"></input>
       </td></tr>
     </table>
</form>

When i am debugging then i found that on the parent page , i m not able to capture the timespent send from child,It is displaying it as object.Please help me out that what the mistake i m doing and how i capture the value of textbox of child page in parent.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T18:56:46+00:00Added an answer on June 4, 2026 at 6:56 pm

    Why dont you use ‘prompt’ which already has this functionality;

    var t=prompt(“timespent”,””);

    If you need styling you could use jprompt(http://www.abeautifulsite.net/blog/2008/12/jquery-alert-dialogs)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a javascript function that checks for a date range. Is there any
I have a javascript datetimepicker that I downloaded online which I use to select
I have written one JavaScript function which would rise the event when the User
I have a JavaScript function which is quite long and performs a number of
I have a javascript function which needs to do a numerical calculation. Some of
I have a javascript function for checking errors which I am calling on OnClicentClick
I would like a JavaScript function to have optional arguments which I set a
in .gsp file i have javaScript function <script type=text/javascript> function getCurrentItemNumber(){ return document.getElementById('item_itemNumber').innerHTML.substr(6); }
I have a javascript function that calls a generic function to make an ajax
I have a javascript function that accepts a number and performs a mathematical operation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.