Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Javascript with Webcontrols

Reply
Thread Tools

Javascript with Webcontrols

 
 
Peter Afonin
Guest
Posts: n/a
 
      04-21-2006
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


 
Reply With Quote
 
 
 
 
Darrin
Guest
Posts: n/a
 
      04-21-2006
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

 
Reply With Quote
 
 
 
 
aruanavekar@gmail.com
Guest
Posts: n/a
 
      04-21-2006
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


 
Reply With Quote
 
Peter Afonin
Guest
Posts: n/a
 
      04-21-2006
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

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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

>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript with Webcontrols Peter Afonin ASP .Net Web Controls 3 04-21-2006 08:49 PM
Object reference not set to an instance of an object. System.Web.UI.WebControls.ListItemCollection.SaveViewState() System.Web.UI.WebControls.ListControl.SaveViewState() Brano ASP .Net 3 11-08-2005 12:29 PM
have javascript utitlity to get whole webcontrols Bear Lin ASP .Net Web Controls 0 05-24-2005 07:57 PM
the webcontrols with javascript . Kylin ASP .Net Web Controls 0 04-25-2005 10:30 AM
Javascript Disabling WebControls Harry ASP .Net 2 08-06-2003 03:54 PM



Advertisments