CA Service Management

  • 1.  how to get the radio button avlue instead of id

    Posted Apr 22, 2017 10:51 AM

    hi i have a form with radio selection (3 options)  

    my radio selection "RequiredFor"  with 3 options 

    (option1  lable="network monitoring", id='1', value="network monitoring"

    (option2  lable="network Maintenance", id='2', value="network Maintenance"

    (option3  lable="network Security", id='3', value="network Security"

     

    i need to return the value of the selected radio  instead of the ID , for example if i select option 2 

    in my script when i use the function to return    var x =ca_fdGetSelectedRadio(ca_fd.formId,'RequiredFor') it reurns the id =2 bu t i need to return the value of the selected radio which= "network Maintenance"

    i tried alot of the tries since i'ma beginner in Java alert( ca_fdGetSelectedRadio(ca_fd.formId,'RequiredFor').value ); but it returns undefined 

    is there is any way to get the value or the lable of the radio ?



  • 2.  Re: how to get the radio button avlue instead of id

    Posted Apr 24, 2017 05:17 AM

    unlike select component (which has ca_fdGetSelectedOptionValues(formId, _id)  to return an array of strings containing the values of the selected options) , the radio component only has ca_fdGetSelectedRadio(formId, groupId)  which

    Returns the _id of selected radio in the group.

     

    So as a workaround you can rename your id  as network_monitoring(since space  is not allowed in _id) , network_Maintenance and network_Security so  this way you can fetch the required string.

     

    If this answer resolves your query , please click on star symbol which denotes helpful.



  • 3.  Re: how to get the radio button avlue instead of id

    Posted Apr 09, 2019 07:02 AM

    you can use this 

    var SeltdOptn =document.querySelector('input[name="radSelectGender"]:checked').value;

    and to test it you can create a radio group for gender add 2 option male and female then name the groupid radSelectGender