Forum Discussion

Alessandro_Cano's avatar
Alessandro_Cano
Icon for Nimbostratus rankNimbostratus
Jan 07, 2016

APM - Radio control values from variable

Hello,

 

is it possible to set the values of a radio control using a custom variable?

 

I've tried using %{session.custom.values} as values, where session.custom.values is "Value1;Value2;Value3"

 

But they are set as a single value.

 

Thanks and regards

 

 

2 Replies

  • Lucas_Thompson_'s avatar
    Lucas_Thompson_
    Historic F5 Account

    There isn't really a built-in way to do this. You'd have to write up some javascript to append the option values into the input element and put that in the Advanced Customization Logon Page. Not too tough, but you'd have to have some familiarity with web programming or pass the project to someone who does, I'd estimate a few hours of dev work and a few hours of cross-browser testing.

     

  • I've found the solution using this example

    Problem can be solved adding this javascript to "function OnLoad()" in logon.inc:

    var full_group_list = "%{session.custom.groups}";
    var groupArray = full_group_list.split(";");
    groupArray.sort();
    var newDiv=document.createElement('div');
    var radioHTML = "";
    for(i=0; i"+groupArray[i]+"";
    }
    newDiv.innerHTML= radioHTML;
    document.getElementById("dynamicInput").appendChild(newDiv);
    

    dynamicInput element needs also to be defined:

        case "radio":
            foreach( $options as $k=>&$o ){
                $fieldStr .= "{$o}";
            }
            $fieldStr = "";
        break;