473,659 Members | 2,996 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Disable Calendar Control from javascrip

Hi,

I'm trying to disable the asp.net calendar control from a javascript
function, but it doesn't disable the doPostBack.

To simplify the situation, assume a page with 4 controls. A dropdownlist, a
calendar control, a textbox and an update button. What I'm doing is
initially setting the button to disabled, the other 3 controls are enabled.
If any data is entered in the textbox, I want to disable the dropdownlist
and the calendar control and enable the update button.

I set the onBlur event of the textbox to a javascript function so that I
will disable the dropdownlist and the calendar control and enable the update
button.

The function runs, the disable of the dropdownlist is fine, the enable of
the update button works, even the graying out of the days on the calendar
happens, but the problem is that the doPostBack on each calendar day is
still enabled allowing the user to click on any day and cause a calendar
postback. I want to block the calendar postback while there is data in the
textbox to update via the update button postback.

The javascript code that I'm using to change the control is:

document.getEle mentById("dropD ownList1").disa bled = true;
document.getEle mentById("Calen dar1").disabled = true;
document.getEle mentById("btnUp date").disabled = false;

I've tried using document.getEle mentById("Calen dar1").Selectio nMode =
"None", document.getEle mentById("Calen dar1").Selectio nMode = "0",
document.getEle mentById("Calen dar1").Selectio nMode = 0, and none of those
did anything.

There doesn't seem to be a way to get the ID of each day so that I could try
to loop through the days and set them to disabled.

If anyone has any ideas I'd appreciate the help.

Bob
Nov 19 '05 #1
0 3359

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2246
by: Larry Woods | last post by:
I have multiple Calendar controls on my page and I want the user to select various dates, then press a Submit button. Is there a way to disable the interrupts from the Calendar controls? TIA, Larry Woods
0
3664
by: Tim Graichen | last post by:
Hello, I am making use of the Active X calendar control (mscal.Calendar.7) in several places in my main form, with the following code Below is an example of the code I'm using for the controls. Private Sub DateSold_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) SoldCal.Visible = True
5
4594
by: Miguel Dias Moura | last post by:
Hello, i am trying to create a .css file with several styles and apply them to the calendar control so i can change the look of: 1. Text Type and Format (Bold, Underline, etc) 2. Background Color 3. Foreground Color 4. Border Tickness 5. Border Color
1
2152
by: bill yeager | last post by:
I would like to place the currently selected date (retrieved from the database) on a calendar control which is embedded inside a datagrid. However, I can't find the ID of the control to do so. During the "Edit" command of the grid, I have the following code: <code> If e.CommandName = "Edit" Then Dim myDatagridItem As DataGridItem Dim lblStartDate As Label Dim lblEndDate As Label
2
3409
by: Caesar Augustus | last post by:
First, let me start by saying my asp.net experience is still in it's infancy so please bare with me as I try to explain my situation. I have created a single page that with the use of many controls (i.e. roundedcorners component www.4guysfromrolla.com], buttons and panels) functions like a tab control. The buttons are programmatically designed to make the corresponding panel visible. Sample aspx.vb code:
3
850
by: Peter | last post by:
Is there anyway to make the System.Web.UI.WebControls.Calendar to display only Month Name and Year, like: January, 2006 February, 2006 ..... .... .... ....
3
2630
by: =?Utf-8?B?UGFycm90?= | last post by:
I applied the following Ajax code in my web page which has a calendar control to keep my page from completely reloading everytime something was changed. <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"/> <atlas:UpdatePanel runat="server" ID="UpdatePanel1" Mode="Conditional"> <ContentTemplate> After inserting this code, my calendar stopped working in that if I clicked on a date, nothing would...
7
2365
by: John Kotuby | last post by:
Hi all, I am trying to use a calendar server control which I have ID="Calendar1" in the source code. What I am trying to do is emulate a JavaScript calendar that was being used in an older ASP version of the application. The javascript version worked nicely -- you click on a calendar.gif in an anchor next to a textbox. The calender would pop up in a new window, you select the date, the calendar window would close and the textbox would be...
3
2723
by: thorpk | last post by:
I posted this problem earlier in the month and some one decided it was better to change the subject and ask a completely different question. I am therefore reposting. I am hoping some one can assist with this. Thanks in advance. I have an access database that i have added a pop up calendar to, the Table information for the Date Reported field is Date/Time format short date, input mask is 00/00/0000.
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8335
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8747
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7356
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
5649
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
4175
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
2752
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
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
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.