pop up calender and populate selected date in a te

Results 1 to 4 of 4

Thread: pop up calender and populate selected date in a te

  1. #1
    minnie Guest

    Default pop up calender and populate selected date in a te

    I have been working on this since two days...<BR><BR>I have a pop up window which is a calender. Then I have a text box which should be populatedwith the selected date from the calender. I have the following code. It works fine in IE but does not in NetScape. It pulls up the calender and when clicked on a date the new window remains there and the text box is not populated.<BR>//MainWindow.asp<BR>&#060;HTML&#062;<BR>&#060;BODY&# 062;<BR>&#060;form method = "POST" id="frmname" name="frmname"&#062;<BR>&#060;input type="text" id=text1 name=text1 width=10 OnKeyPress="javascript:calpopup()"&#062;<BR><BR>&# 060;Script Language="javaScript"&#062;<BR>function calpopup(){<BR><BR>window.open("../Calender/date.asp?","calpopup","toolbar=0,location=0,status =0,menubar=0,scrollbars=0,resizable=1,top=100,left =100,width=350,height=200");<BR>}<BR>&#060;/script&#062;<BR>&#060;/form&#062;<BR>&#060;/BODY&#062;<BR>&#060;/HTML&#062;<BR><BR>//date.asp//<BR><BR>&#060;BODY BGColor="Silver" alink="#526B84" vlink="#526B84" onBlur="javascript:self . focus ();"&#062; <BR>&#060;SCRIPT LANGUAGE="javascript"&#062; <BR> function calpopulate(dte) { <BR> window.opener.&#060;%=formname & "." & elementname%&#062;.value = dte;<BR> self.close() <BR> } <BR>&#060;/SCRIPT&#062; <BR>&#060;/Body&#062;<BR>&#060;/HTML&#062;<BR><BR>dte : is the value of the selected date...which is working fine in both the cases.<BR><BR>Any idea...Heeelllpp!

  2. #2
    Join Date
    Dec 1969
    Posts
    119

    Default RE: pop up calender and populate selected date in

    I am not sure just try this out,<BR><BR>In your following code<BR><BR>function calpopulate(dte) { <BR>window.opener.&#060;%=formname & "." & elementname%&#062;.value = dte;<BR>self.close() <BR>} <BR><BR>after opener say document<BR><BR>i.e.<BR><BR>window.opener.document .<BR><BR>

  3. #3
    John Weeflaar Guest

    Default RE: pop up calender and populate selected date in

    I think You&#039ll need to define the calpopup() function twice.<BR>The reason is calpopup() function is called from the onKeyPress<BR>event (which is only available in javascript 1.2 of Netscape version).<BR>Put One in &#060;Script Language="javascript"&#062;...&#060;/Script&#062;<BR>and the other in &#060;Script Language="javascript1.2"&#062;...&#060;/Script&#062;.<BR>The other function I think can be put in both or just in the <BR>the &#060;Script Language="javascript"&#062;...&#060;/Script&#062; because onBlur event is available in javascript 1.0.<BR>See your other similar question.<BR><BR>

  4. #4
    minnie Guest

    Default RE: pop up calender and populate selected date in

    tried it. Didn&#039t work


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •