CA Service Management

  • 1.  Radio selection not being submitted

    Posted Nov 23, 2016 12:01 PM

    I have two radio buttons, with distinct vales and ids, that are set up to display their selection in a text box. It seems to be that the value being passed is the radio's _id (and not value). After I submit the form, and go back to review what's been sent, I see that the radio's text in my text box is now "null". What's going on here?

     

    I am using the correct javascript call -

    var radioName = ca_fdGetSelectedRadio(ca_fd.formId, 'radio_name');

     

    But I must be missing something.



  • 2.  Re: Radio selection not being submitted

    Posted Nov 23, 2016 02:41 PM

    var radioName = ca_fdGetSelectedRadio(ca_fd.formId, 'radio_name');  is the correct way to set the value of a radio button group to a variable.

     

    But how do you set this value to your textbox?

    On an event?

     

    Do you set "radioName" as the value? Is the ca_fdGetSelectedRadio executed prior to setting the textbox value?

     

     

    If you call a function on the "onChange"  event of a radioButton, it will not be called when you load the form after its submition.

     

     

    We need more information to help you



  • 3.  Re: Radio selection not being submitted

    Posted Nov 23, 2016 02:59 PM

    Here is my code:

     

    xyz: function() {

          var radioName = ca_fdGetSelectedRadio(ca_fd.formId, 'radio_name');

          ca_fdSetTextFieldValue(ca_fd.formId, 'textBox', radioName);

    }

     

    And then on each radio button's onChange event: ca_fd.js.xyz();

     

    Radio buttons are:

    Yes - value: 1, _id: yes

    No - value: 0, _id: no



  • 4.  RE: Re: Radio selection not being submitted

    Posted Jul 29, 2019 03:10 PM
    I cannot seem to find "ca_fdGetSelectedRadio" anywhere within the documentation that I have.  Could someone point me to where the documentation (and potentially other functions) for it may exist?


  • 5.  RE: Re: Radio selection not being submitted
    Best Answer

    Posted Jul 29, 2019 11:34 PM
    1. Log into Service Catalog
    2. Go to Administration tab
    3. Go to Tools sub-tab
    4. Select Links menu
    5. Click on Form Designer JavaScript API


    ------------------------------
    Lindsay Estabrooks
    Principal Consultant
    IT-EDU Consultants
    ------------------------------



  • 6.  Re: Radio selection not being submitted

    Posted Nov 23, 2016 03:09 PM

    As I said, radio button's event "onChange" is not fired when you load a form.

     

    So you may want to call xyz function in the onLoad event of your form.

     

    onLoad : function(){

    ca_fd.js.xyz();

    },

    xyz : function(){

    var radioValue = ca_fdGetSelectedRadio(ca_fd.formId)'radio_name');

    if(typeof(radioValue) != "undefined" && radioValue != "")

       ca_fdSetTextFieldValue(ca_fd.formId, 'textbox',radioValue);

    }

     

     

    Set onLoad(); on the onLoad attribute of your form.