473,387 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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.getElementById("dropDownList1").disabled = true;
document.getElementById("Calendar1").disabled = true;
document.getElementById("btnUpdate").disabled = false;

I've tried using document.getElementById("Calendar1").SelectionMode =
"None", document.getElementById("Calendar1").SelectionMode = "0",
document.getElementById("Calendar1").SelectionMode = 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 3336

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

Similar topics

6
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, ...
0
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...
5
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...
1
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....
2
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...
3
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
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"...
7
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...
3
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.