|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Javascript with WebcontrolsI'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 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 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: Show quoteHide quote > 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 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 <aruanave***@gmail.com> wrote in message Show quoteHide quote news:1145590010.341428.68420@t31g2000cwb.googlegroups.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 >
MyGridView cause "Columes" lose the intellisense in VS2005 IDE!
CompositeControl and Toolbox Print version use CSS or similar ? A socket operation was attempted to an unreachable network ID of web control changed Sorting Datagrid Can i Make a Month Column Display May instead of 5 2.0 TreeNode How to get dynamic control's value after postback? Edit, Update, Cancel |
|||||||||||||||||||||||