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; return false; } }
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EnterTimeSpent.aspx.cs" Inherits="EmployeeQuotient.EnterTimeSpent" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <link href="CSS/buttons.css" rel="stylesheet" type="text/css" /> <title>Enter Time Spent</title> </head> <body> <script language="javascript" type="text/javascript"> </script> <form id="form1" runat="server"> <div> <table> <tr> <td> <asp:Label ID="Label1" runat="server" Text="Time Spent : " Font-Bold="True" Font-Italic="False" Font-Names="Times New Roman" Font-Size="Small" ForeColor="green"></asp:Label> </td> <td> <asp:TextBox ID="txtTimeSpent" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTimeSpent" ErrorMessage="Field Cant be left blank." Font-Size="X-Small" ForeColor="Red"></asp:RequiredFieldValidator><br /> <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtTimeSpent" ValidationExpression="^\d+$" ErrorMessage="Only Numeric with non decimal allowed" Font-Size="X-Small" ForeColor="Red"></asp:RegularExpressionValidator></td> </tr> <tr> <td> <asp:Button ID="btnSubmitTimeSpent" runat="server" Text="Submit" CssClass="button small green rounded" OnClientClick="btnSubmitTimeSpent()"/></td></tr> </table> </div> </form> </body> </html>
<asp:textbox id="Txtparent" runat="Server" xmlns:asp="#unknown" />
window.opener.document.forms[0].getElementById('Txtparent').value ="Value From Popup Page";
function btnSubmitTimeSpent() { window.returnValue="time"; window.close(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)