Login  
Search All Forums
Dart Home | PowerWEB LiveControls for ASP.NET | Custom Development Reply | PowerWEB LiveControls for ASP.NET Topics | Forums   
AuthorForum: PowerWEB LiveControls for ASP.NET
Topic: LiveRadioButtonList on click
bbrackeen

From: Dallas, TX USA
Posts: 8
Member Since: 02/03/06
posted April 5, 2006 1:39 PM

Hi,

I'm trying to execute some client side javascript using a radio button onclick event. However it never seems to work. I've tried the following.

LiveradiobuttonIsSMPPricing.BufferedScript.Write("smpBillingEnable();");

and

LiveradiobuttonIsSMPPricing.Attributes.Add("onclcik", "smpBillingEnable();");

How can I accomplish this?
bbrackeen

From: Dallas, TX USA
Posts: 8
Member Since: 02/03/06
posted April 5, 2006 1:45 PM

Except I did actually spell onclick correctly in the code behind. (incorrect above). ;)
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted April 5, 2006 5:54 PM

Hi,
I just tried a very simple example.
First, I added the following to the head tags of the WebForm:

<script>function showAlert(){alert('hello');}</script>

Then I added the following Click event code:

private void LiveRadioButton1_CheckedChanged(object sender, System.EventArgs e)
{
LiveRadioButton1.BufferedScript.Write("showAlert();");
}

When I ran the page and selected the radio button, I saw the alert message.

Does this work for you?
If so, how is what you are doing different?

Thanks,
-ken
bbrackeen

From: Dallas, TX USA
Posts: 8
Member Since: 02/03/06
posted April 13, 2006 12:34 PM

Here is one solution to gain access to the onclick event in javascript. Works for initial load and postback.. Hope it helps some otheres.

 function document.all.LiveradiobuttonlistIsSeasonalMerchant_0.onclick()
  {
   seasonalMonthsEnable();
  }
  
  function document.all.LiveradiobuttonlistIsSeasonalMerchant_1.onclick()
  {
   seasonalMonthsEnable();
  }
    
  function seasonalMonthsEnable()
  {
   var isDisabled = !document.all.LiveradiobuttonlistIsSeasonalMerchant_0.checked;
   
   document.all.LivecheckboxIsSeasonalClosedJan.disabled = isDisabled;
   document.all.LivecheckboxIsSeasonalClosedFeb.disabled = isDisabled;
   document.all.LivecheckboxIsSeasonalClosedMar.disabled = isDisabled;
   document.all.LivecheckboxIsSeasonalClosedApr.disabled = isDisabled;
   document.all.LivecheckboxIsSeasonalClosedMay.disabled = isDisabled;
   document.all.LivecheckboxIsSeasonalClosedJun.disabled = isDisabled;
   document.all.LivecheckboxIsSeasonalClosedJul.disabled = isDisabled;
   document.all.LivecheckboxIsSeasonalClosedAug.disabled = isDisabled;
   document.all.LivecheckboxIsSeasonalClosedSep.disabled = isDisabled;
   document.all.LivecheckboxIsSeasonalClosedOct.disabled = isDisabled;
   document.all.LivecheckboxIsSeasonalClosedNov.disabled = isDisabled;
   document.all.LivecheckboxIsSeasonalClosedDec.disabled = isDisabled;
   
   if (isDisabled)
   {
    document.all.LivecheckboxIsSeasonalClosedJan.checked = false;
    document.all.LivecheckboxIsSeasonalClosedFeb.checked = false;
    document.all.LivecheckboxIsSeasonalClosedMar.checked = false;
    document.all.LivecheckboxIsSeasonalClosedApr.checked = false;
    document.all.LivecheckboxIsSeasonalClosedMay.checked = false;
    document.all.LivecheckboxIsSeasonalClosedJun.checked = false;
    document.all.LivecheckboxIsSeasonalClosedJul.checked = false;
    document.all.LivecheckboxIsSeasonalClosedAug.checked = false;
    document.all.LivecheckboxIsSeasonalClosedSep.checked = false;
    document.all.LivecheckboxIsSeasonalClosedOct.checked = false;
    document.all.LivecheckboxIsSeasonalClosedNov.checked = false;
    document.all.LivecheckboxIsSeasonalClosedDec.checked = false;
   }
Reply | PowerWEB LiveControls for ASP.NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX