473,748 Members | 2,361 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dropdown calendar control with HTML <INPUT> control

5 New Member
Hai all,

I am trying to create dropdown calendar control with HTML input control by writing JavaScript. But while executing I am getting the error as "Error on Page" on the status bar of the browser. I wrote the following code in the HTML code for the web form:

<%@ Page language="c#" Codebehind="Web Form2.aspx.cs" AutoEventWireup ="false" Inherits="calen dar.WebForm2" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<script type="text/javascript">
<!--
function onClick()
{
if (divCalendar.st yle .display ="none")
divCalendar.sty le .display ="";
else
divCalendar.sty le .display ="none";
}
//-->
</script>

<title>WebForm2 </title>
<meta content="Micros oft Visual Studio .NET 7.1" name="GENERATOR ">
<meta content="C#" name="CODE_LANG UAGE">
<meta content="JavaSc ript" name="vs_defaul tClientScript">
<meta content="http://schemas.microso ft.com/intellisense/ie5" name="vs_target Schema">
</HEAD>
<body MS_POSITIONING= "GridLayout " onload ="hello()">
<form id="Form1" method="post" runat="server">
<DIV id="divCalendar " style="Z-INDEX: 104; LEFT: 392px; WIDTH: 256px; POSITION: absolute; TOP: 144px; HEIGHT: 216px"
ms_positioning= "FlowLayout"><a sp:textbox id="TextBox1" runat="server"> </asp:textbox><INPUT id="onClick" onclick ="onClick()" type="button" value="Call function">
<asp:calendar id="Calendar1" runat="server" Visible="False" ></asp:calendar></DIV>
<asp:button id="Button1" style="Z-INDEX: 102; LEFT: 184px; POSITION: absolute; TOP: 8px" runat="server"
Text="Button"></asp:button></form>
<noscript>
This browser does not support script</noscript>
</body>
</HTML>

If I use webserver button control instead of HTML input control and I write the following code

private void Button1_Click(o bject sender, System.EventArg s e)
{
if(Calendar1.Vi sible ==true)
Calendar1.Visib le =false;
else
Calendar1.Visib le =true;
}


in the button click event, then it is working fine.
My requirement is the calendar control is to be displayed when I click the HTML Input control. If I click once again it should disappear.
Please help me where I am doing mistake while writing JavaScript.
May 10 '07 #1
2 10722
MMcCarthy
14,534 Recognized Expert Moderator MVP
This question is being moved to the HTML forum.

ADMIN
May 10 '07 #2
drhowarddrfine
7,435 Recognized Expert Expert
Moved to asp.
May 11 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
7510
by: Bhavin | last post by:
Hi I'm trying to set default value for input type file. <input type="File" name="tx_pdffile" accept="*.pdf" class="boxText" value="abc.pdf"> but this value (abc.pdf) doesnt appear in the text box.. Whats the solution???
4
21296
by: Martin Lucas-Smith | last post by:
I am wanting to know whether are XHTML1-valid characters for use within an id attribute and/or a name attribute. http://validator.w3.org/check?uri=http://www-thaihydro.geog.cam.ac.uk/riverslice/&ss=1&verbose=1 (e.g. see line 77) suggests that it is valid, but the spec suggests that it is not. More detail:
2
5964
by: not 2 swift | last post by:
I thought I would update an old page on which I had used a <INPUT TYPE=image ...> with a <BUTTON><IMG SRC=...></BUTTON> The problem is that <BUTTON> always provides a shadow/emboss effect. Can I get rid of that? If the old <INPUT> button has been deprecated in favor of <BUTTON>, have all it's button functions been duplicated? Thanks for any help,
3
12196
by: iinet | last post by:
How can i set in my css a min width for input elements, but leave the max size dynamic? Ben
3
13154
by: TR | last post by:
Is it possible with CSS to prevent this wrapping alignment with a checkbox with a nested label? This is the label of the checkbox that wraps beneath it I'd prefer it looked like this, with a flush left margin:
3
12936
by: Ben | last post by:
Here's my form: <form name="aForm" method='post'> <input type=file name=file1 onkeypress='KeyPress()'><br> <a id='attachMoreLink' href='javascript:AddFileInput()">Attach More Files </a> <input type=submit value='Done'> </form>
1
2269
by: Knut-Frode Dagestad | last post by:
I have a <selectlist in some html code with hundreds of options. Is it possible to use javascript to jump to the next/previous item in the list? Knut-Frode
2
3385
by: Richard Maher | last post by:
Hi, I'm trying to use the Visibility Style attribute for a Div to effectively PopUp a lightweight window with some additional context-sensitive information, when a user mouses over a given field(s). The popping-up seems to work just fine; it's the tearing down that's giving me grief. If I stick a onmouseout event on the same input field that caused the onmouseover/pop-up, it starts to flicker 'cos the <divis placed for esthetically...
3
10391
by: Gert | last post by:
Would it be possible to access the file CONTENT in codebehind for a standard: <input id="htmlFile" type="file" /> Then in codebehind: foreach (string keyName in System.Web.HttpContext.Current.Request.Form.Keys) { //i can see keyName = "htmlFile" here as well as the "c:/myfile.txt" for example
0
9530
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9312
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9238
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8237
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4593
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.