Passing radio button selection value to Javascript snippet, syntax problems

Hi All, Seeking to take a programmatic action based on the selected radio button option, using Javascript snippet embedded below radiobox selection grouping. The code illustrated in the screenshot sometimes returns a setting value as undefined and fails on the two-word captions. Please advise on correct syntax to retrieve the selected option. Many thanks.  
1 answers

The snippet inserts the value of your attribute as plain text, so your old example would translate to:

General Advice;

alert("Current value " + General Advice);

Which isn’t valid javascript. I’m honestly kinda surprised if you ever got the desired result with the current snippet.

I can’t test this right now, but I’m pretty sure the following should work:

alert("Current value: ${currentType}");