Disabling controls
-
Hi guys, I want to ask a question about diabling a control. I have to select boxes, regions and areas. And a text box that represents a unique ID. Now I only want the user to search either by location, or by unique ID. So if the user selects a region, all the areas for that regions are loaded in the area select control. Then, in the same process, it should make the textbox ReadOnly (so that no data can be entered), which works fine. But my problems comes is, if the user starts to type in a unique ID, then it should disable the 2 select boxes. If the textbox is cleared, then the 2 select boxes are enabled again. I'm not sure if there is an event that checks for this? I think there is an event for the textbox something like text changed, but this doesn't work when I start typing in text, probably because it doesn't make a trip to the server. Is my only option for this via Javascript? Or can I do this on the server? I'm using C#. Regards. -- modified at 3:23 Thursday 13th October, 2005
-
Hi guys, I want to ask a question about diabling a control. I have to select boxes, regions and areas. And a text box that represents a unique ID. Now I only want the user to search either by location, or by unique ID. So if the user selects a region, all the areas for that regions are loaded in the area select control. Then, in the same process, it should make the textbox ReadOnly (so that no data can be entered), which works fine. But my problems comes is, if the user starts to type in a unique ID, then it should disable the 2 select boxes. If the textbox is cleared, then the 2 select boxes are enabled again. I'm not sure if there is an event that checks for this? I think there is an event for the textbox something like text changed, but this doesn't work when I start typing in text, probably because it doesn't make a trip to the server. Is my only option for this via Javascript? Or can I do this on the server? I'm using C#. Regards. -- modified at 3:23 Thursday 13th October, 2005
Unfortunately for right now, if you're wanting to do real time text checks on the web page then some type of Client side script (such as Javascript) is your only option. The only way for the server to manage this is for the page to postback to the server every time the user presses a key in the textbox, which would keep them from typing more than say.. 3 words per minute.
-
Hi guys, I want to ask a question about diabling a control. I have to select boxes, regions and areas. And a text box that represents a unique ID. Now I only want the user to search either by location, or by unique ID. So if the user selects a region, all the areas for that regions are loaded in the area select control. Then, in the same process, it should make the textbox ReadOnly (so that no data can be entered), which works fine. But my problems comes is, if the user starts to type in a unique ID, then it should disable the 2 select boxes. If the textbox is cleared, then the 2 select boxes are enabled again. I'm not sure if there is an event that checks for this? I think there is an event for the textbox something like text changed, but this doesn't work when I start typing in text, probably because it doesn't make a trip to the server. Is my only option for this via Javascript? Or can I do this on the server? I'm using C#. Regards. -- modified at 3:23 Thursday 13th October, 2005
ma se wrote:
but this doesn't work when I start typing in text, probably because it doesn't make a trip to the server.
That's exactly why. ASP.NET is a server-side only technology designed to generate HTML for browsers. It's can't interact with the client in real-time.
ma se wrote:
Is my only option for this via Javascript?
Yep. JavaScript is your only option if you want cross-browser compatibility. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome