Wrox Programmer Forums
|
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 20th, 2004, 05:04 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default onClick event calendar

Please how can open the calendar onClick event in the ASP and
return date into textbox ?
(visual studio 6.0 interdeav)

<TR>
    <TD>Date</TD>
    <TD><INPUT type=text id=text3 name=text3><INPUT id=calendar type=button value=Button name=button1 onClick=" "></TD></TR>
  </TR>




Mateen





 
Old January 23rd, 2004, 08:02 AM
Authorized User
 
Join Date: Jul 2003
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alex_read
Default

Here's the way I did it which may/may not be of use to you...

Form1 shows a textbox, and a button or link prompting the user to select a date. This button/link directs to the ShowCalendarPopup() javascript function on the same web page.

This function opens a new popup window (form 2) which has a calendar control (okay so I was using .net here), a hidden field, and an okay button/link.


function ShowCalendarPopup() {
    window.open("wfpopupCalendar.aspx",null,"height=23 0,width=220,status=no,toolbar=no,menubar=no,locati on=no");
}

function SetNewJobItemDate(strNewChosenDate) {
    document.FormNameHere.elements('TextBoxNameHere'). value = strNewChosenDate;
}


When the user chooses a new date in this form2 screen, this chosen value's placed into the hidden field (again by a javascript routine).

When the user confirms the value / hits the ok button/link, the following RetSelValueToRequest() javascript function is fired to return the chosen value, from the hidden field, into the above SetNewJobItemDate() javascript function on form1 (which takes the value & places it into the textbox on form1).

function RetSelValueToRequest() {
    window.opener.SetNewJobItemDate(document.FormNameH ere.hidChosenDate.value);
    self.close();
}




 
Old January 24th, 2004, 01:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for your response.

I am using visual studio 6.0, I use javascript but it give following error.

"Server Error
The resource cannot be found. "


Please how can use this script in 6.0 (not .net)
I change wfpopupcalendar.asp

it only open the wfpopupcalendar form,
how can open the calendar in interdeave 6.0 ?

<html>
<head>
<script language=javascript>
{
function ShowCalendarPopup() {
    window.open("wfpopupCalendar.asp",null,"height=230 ,width=220,status=no,toolbar=no,menubar=no,locatio n=no");
}

function SetNewJobItemDate(strNewChosenDate) {
    document.FormNameHere.elements('strdate').value = strNewChosenDate;
}


}

</script>
</head>

<body>
<table>
<TR>
    <TD>Start Date</TD>
    <TD><INPUT id=strdate name=strdate><INPUT id=calendar type=button value=Calendar name=calendar onClick="ShowCalendarPopup()"></TD></TR>
  <TR>
</table>

</body>
</html>


Mateen


Quote:
quote:Originally posted by alex_read
 Here's the way I did it which may/may not be of use to you...

Form1 shows a textbox, and a button or link prompting the user to select a date. This button/link directs to the ShowCalendarPopup() javascript function on the same web page.

This function opens a new popup window (form 2) which has a calendar control (okay so I was using .net here), a hidden field, and an okay button/link.


function ShowCalendarPopup() {
    window.open("wfpopupCalendar.aspx",null,"height=23 0,width=220,status=no,toolbar=no,menubar=no,locati on=no");
}

function SetNewJobItemDate(strNewChosenDate) {
    document.FormNameHere.elements('TextBoxNameHere'). value = strNewChosenDate;
}


When the user chooses a new date in this form2 screen, this chosen value's placed into the hidden field (again by a javascript routine).

When the user confirms the value / hits the ok button/link, the following RetSelValueToRequest() javascript function is fired to return the chosen value, from the hidden field, into the above SetNewJobItemDate() javascript function on form1 (which takes the value & places it into the textbox on form1).

function RetSelValueToRequest() {
    window.opener.SetNewJobItemDate(document.FormNameH ere.hidChosenDate.value);
    self.close();
}









Similar Threads
Thread Thread Starter Forum Replies Last Post
XSLT - onclick event Condor76 XSLT 1 June 1st, 2007 04:53 PM
DataGrid onclick event? hany ASP.NET 1.0 and 1.1 Professional 7 January 1st, 2006 05:21 AM
onclick event bjackman Access 6 July 15th, 2004 06:54 AM
onclick event pigtail Javascript 1 April 11th, 2004 03:10 PM
onClick Event mateenmohd Javascript 4 December 16th, 2003 01:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.