Home All Groups Group Topic Archive Search About
Author
21 Apr 2006 3:01 AM
Peter Afonin
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

Author
21 Apr 2006 3:10 AM
Darrin
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
Author
21 Apr 2006 3:26 AM
aruanavekar
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
Author
21 Apr 2006 8:49 PM
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
>