473,387 Members | 1,700 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.

Javascript with Webcontrols

Hello,

I'd used before methods like RegisterStartupScript with ASP.NET, but this
problem I was unable to solve yet using this method.

I have a web form with a few web controls - textbox, dropdown lists,
calendar control. If the textbox has a value- I need to disable all other
controls when it looses focus (onblur event), if it's empty - enable them.
The texbox I can replace with a HTML control instead of web control, but the
other controls I cannot.

Is it possible to do this?

I would appreciate your help on this.

Thank you,

--
Peter Afonin
Apr 21 '06 #1
3 1299
I assume when you say web controls, you are talking about the ASP.NET
server controls instead of plain html controls. You should be able to
do the same actions on a server control on the client as you would with
an html control alone. The key (for me at least when I first messed
with it) is to use the ClientID property of the control server side to
get what the control id will be when accessing it from javascript on
the client. I would then send my script the way you had mentioned.

-Darrin

Apr 21 '06 #2
Did you tried specifying ID and runat attributes to respected HTML tags
and access them by thier ID names from the webform?

Aru

Peter Afonin wrote:
Hello,

I'd used before methods like RegisterStartupScript with ASP.NET, but this
problem I was unable to solve yet using this method.

I have a web form with a few web controls - textbox, dropdown lists,
calendar control. If the textbox has a value- I need to disable all other
controls when it looses focus (onblur event), if it's empty - enable them.
The texbox I can replace with a HTML control instead of web control, but the
other controls I cannot.

Is it possible to do this?

I would appreciate your help on this.

Thank you,

--
Peter Afonin


Apr 21 '06 #3
Hello,

Thank you for all your suggestions.

Yes, all my web controls have IDs. But the problem is that Javascript
doesn't "see" server controls! Maybe I'm doing something wrong, but I could
never make it work. Every time I was using Javascript with the web forms I
had to either use HTML controls with runat="server" tag or to register a
Javascript with RegisterStartupScript method.

Thank you,

Peter

<ar*********@gmail.com> wrote in message
news:11*********************@t31g2000cwb.googlegro ups.com...
Did you tried specifying ID and runat attributes to respected HTML tags
and access them by thier ID names from the webform?

Aru

Peter Afonin wrote:
Hello,

I'd used before methods like RegisterStartupScript with ASP.NET, but this problem I was unable to solve yet using this method.

I have a web form with a few web controls - textbox, dropdown lists,
calendar control. If the textbox has a value- I need to disable all other controls when it looses focus (onblur event), if it's empty - enable them. The texbox I can replace with a HTML control instead of web control, but the other controls I cannot.

Is it possible to do this?

I would appreciate your help on this.

Thank you,

--
Peter Afonin

Apr 21 '06 #4

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

Similar topics

0
by: Michelle Keys | last post by:
I am trying to call a print function to print a string from a database using javascript. Which is RC_DATA of Varchar2(2500). This is a javascript is not being used. I have a thing that needs to...
3
by: IntraRELY | last post by:
I need to attach the following 2 little scripts to an ASP.NET Button. I am having an issue with running both of the Attributes.Add. I can only get on to work at once. I have also tried to put them...
2
by: Ashish | last post by:
Hello, I am sick and tired of ochestrating server and client side scripts. Basically I am using toolbar from IE web controls and want to attach javascript to one of the buttons' click event. The...
4
by: Bob P. | last post by:
Hello, I have a page with: * two side-by-side asp:listboxes and two arrow asp:buttons allowing users to add/remove email addresses between them -- very much like Outlook, where you have the...
1
by: Jorge Ponte | last post by:
hi I have a Web User Control (ascx) - lets call it "My_WUC" - in a Web form. In that WUC I want have a textbox and a button. I want to click on the button and open a popup (I use javascript for...
8
by: Bishoy George | last post by:
how to let javascript code understand txtUser.Text? in window.open("WebForm26.aspx?User=txtUser.Text",.....................)
3
by: Peter | last post by:
Hello, We are inserting a side menu to our application using a class that is writing HTML on all our pages. This is a part of the code as an example: writer.Write(" <table WIDTH=""100%""...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
0
by: Wyatt70 | last post by:
I'm attempting to implement a javascript popup calendar in a DataGrid. The calendar will be used to insert a date into a textbox. I keep getting a "System.NullReferenceException: Object reference...
4
by: patrick.sannes | last post by:
Hi there, I'm creating a custom control with Javascript and CSS. It will be a nice overlay calendar with a result textbox. My main problem is that the Javascript is realy huge, so you want to...
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: 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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
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.