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]]
> Sent: Sunday, May 30, 1999 11:59 PM
> To: [EMAIL PROTECTED]
> Cc: [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
>
> For dire need help, email: [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]