How to create radio button in custom widget and how to retreive this radio button value in same form in the next step
Hi Prathyusha
You can create radio buttons in custom widget same way as using simple html form and also get the selection values using javascript in controller.
for better understanding just use followings.
Template
form
id="radioButtonForm" name="radioButtonForm"
input type="radio" name="buttons" value="1"
input type="radio" name="buttons" value="2"
input type="radio" name="buttons" value="3"
input type="radio" name="buttons" value="4"
/form
span id="result" /span
FYI: add <,> symbols wisely
Controller
function ($scope) {
document.radioButtonForm.onclick = function(){
var radioButtonValue = document.radioButtonForm.buttons.value;
result.innerHTML = 'You selected: '+radioButtonValue; };
}
Hope it will help you !!
Kaant,