Client Side - click radio button - controls become enabled

  • Thread starter Thread starter UJ
  • Start date Start date
U

UJ

Can somebody help me please? I have two 'sets' of controls on a page. There
are two radio buttons that enable the two sets (when radiobutton A is
checked, set A should be enabled, B, Set B should be enabled). I know how to
do it on the server side but not on the client side (I'd rather not have the
page reload).

Can somebody help me? I know I need to use Javascript but don't have a clue
on how to do it.

TIA - Jeffrey.
 
Jeffrey,

Put every set in a container - a div, or a table or a table cell. For the
radio buttons handle onclick event. In the event handler control the
container visibility like this:

myContainer.style.display='none';
myContainer.style.display='inline';

And you do need to learn some basics about javascript, no way around,

Eliyahu
 
Thanks Eliyahu. I finally got the thing working correctly.

Now here's the next problem - when I originally load the page, I don't have
anything filled in so I know the startup state. But there are conditions
where I will pre-load the page values which means I need to be able to set
the screen accordingly.

In other words, I need to be either able to set the visibility from both the
client side and the server side, or I need to be able to on page load call
some javascript to be able to activate the appropriate items.

(I'm also going to post a separate item in here for this same problem.)

Any suggestions?

Thanks - Jeffrey.
 
Prepare css styles in design time and in run time set CssClass property for
web controls on server side or className property on client side.

Eliyahu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top