Hi,

Change the defualt html tag of the radiobuttongroup generated to add the
onClick clause to all the buttons. 
Call the function on click of any radio button. Catch the value of the
clicked button, set in a hidden field and submit the form. This value
can be obtained on the this_onBeforeDisplayEvent of the page.
Accordingly you can set which page to load when the href is clicked. The
difference from the case of a buton here is that the page is reloaded as
soon as one clicks any radio button. This might take sometime on the
very first click but thereafter it does that almost immmediately. Foll.
may help you :

<INPUT TYPE=RADIO NAME="rbTestTypeOpr"  VALUE="Add" onClick =
"setTestTypeOpr( ) ">Add<INPUT TYPE=RADIO NAME="rbTestTypeOpr"
VALUE="Edit" onClick = "setTestTypeOpr( ) " >Edit / View

function setTestTypeOpr()
{
        var strTestTypeOpr = "";
        var strRbClickedFlag = "";
        for ( i=0; i<2; i++ )
        {
                if (document.pgMenu.rbTestTypeOpr[i].checked)
                {
                    strTestTypeOpr =
document.pgMenu.rbTestTypeOpr[i].value;
                    strRbClickedFlag = "1";     
                }    
        }
        document.pgMenu.hdTestTypeOpr.value = strTestTypeOpr;
        document.pgMenu.hdRbClickedFlag.value = strRbClickedFlag;
        document.pgMenu.submit();

}

Regds,
Deepak



                -----Original Message-----
                From:   [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>  [mailto:[EMAIL PROTECTED]]
<mailto:[mailto:[EMAIL PROTECTED]]> 
                Sent:   Saturday, June 12, 1999 1:29 PM
                To:     [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 
                Subject:        [ND] HELP PLEASE! RE: [ND] Getting Radio
Button value on click of an HREF

                Hi,

                 I am trying to load a page on the click of an HREF
based on the radio button selection 
                on the same page. 

                I understand that this may not work bcos, a URL click is
different from a submit button of a FORM
                where the selections on the page are available to make
the decision of which page to load.

                 Can some one suggest a work around to the problem
please??

                BTW, Somebody had used JAVAScript's onclick event, but I
don't exactly know how. (A code snippet would help)

                Thanx in advance.

                - Art.


                "Hill, Les" <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> wrote:
                >Deepak,>
                >You are running into the basic difference between HREFs
(HTTP GET) and FORMs
                >(HTTP POST).  This is a web issue and not ND.  The
difference is this,
                >for HREFs NO ADDITIONAL INFORMATION is sent with the
request.  For FORMs,
                >all the INPUT FIELDS are passed along with the request
(even if the FORM
                >method specifies using GET!)
                >
                >[EMAIL PROTECTED]
                >Team NetDynamics
                >
                >> -----Original Message-----
                >> From:        Deepak Kumar Adhikary
[SMTP:[EMAIL PROTECTED]] <mailto:[SMTP:[EMAIL PROTECTED]]> 
                >> Sent:        Sunday, May 30, 1999 11:59 PM
                >> To:
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 
                >> Cc:  [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 
                >> Subject:     [ND] Getting Radio Button value on click
of an HREF
                >> Importance:  High
                >> 
                >> Hi,
                >> 
                >> I want to get the selected radio button value after I
click an href .
                >> 
                >> I tried this in ND side as well as from JavaScript
for an href and a
                >> button. I find that the value is not caught in the
case of an href
                >> unlike clicking a button where the entire content of
the form is
                >> submitted. 
                >> 
                >> I put exactly the same code for both cases :
                >> 
                >> public int Href1_onWebEvent(CSpWebEvent event)
                >> {
                >> 
                >> String strOprType ="";
                >> //strOprType =
getDisplayFieldValue("RadioButton1").stringValue();
                >> CSpRadioButtonsGroup rbTestTypeOpr =
(CSpRadioButtonsGroup)
                >> getDisplayField ("RadioButton1"); 
                >> CSpSelectable currSelected =
rbTestTypeOpr.getSelected (); 
                >> CSpValue selectedValue = currSelected.getValue (); 
                >> strOprType = selectedValue.stringValue();
                >> 
                >> The var strOprType always have the default value of
the radio button set
                >> in the studio no matter whichever radio button is
selected. But the
                >> value comes ok for a button.
                >> 
                >> 
                >> << The following part is executed after the
javascript function "
                >> fnRadio( ) " where a hidden variable hdRad is set
>>      
                >> 
                >> String strRad = "";  
                >> strRad = getDisplayFieldValue("hdRad").stringValue();

                >> CSpLog.send(this, CSpLog.CRITICAL, "hdRad = " +
strRad);
                >> 
                >> In the studio onClick = "  document.pgOne.submit( ) "
has been put in
                >> the ExtraHTMLText for the href.
                >> 
                >> function fnRadio( )  
                >> {
                >>      alert("Entered function");
                >>      var stRad = "";
                >>      for ( i=0; i<4; i++ )
                >>      {
                >>              if
(document.pgOne.RadioButton1[i].checked)
                >>
stRad=document.pgOne.RadioButton1[i].value;     
                >>      }
                >>      document.pgOne.hdRad.value = stRad;
                >>      alert("hdRad = " + document.pgOne.hdRad.value);
                >>      return true;
                >>      
                >> }
                >> 
                >> Again here, the value strRad does not get populated
for the href case
                >> unlike the button. 
                >> 
                >> What is the solution for the situation ??
                >> 
                >> TIA,
                >> Deepak
                >> 
                >>
________________________________________________________________________
_
                >> 
                >> For help in using, subscribing, and unsubscribing to
the discussion
                >> forums, please go to:
http://www.netdynamics.com/support/visitdevfor.html
<http://www.netdynamics.com/support/visitdevfor.html> 
                >> 
                >> For dire need help, email: [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 

        
________________________________________________________________________
_

                For help in using, subscribing, and unsubscribing to the
discussion
                forums, please go to:
http://www.netdynamics.com/support/visitdevfor.html
<http://www.netdynamics.com/support/visitdevfor.html> 

                For dire need help, email: [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 
_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

Reply via email to