- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2024 06:27 AM
Hi,
Used Radio buttons widget:
<label><input type="radio" name="food_preference" ng-model="data.veg"> Veg</label><br>
<label><input type="radio" name="food_preference" ng-model="data.nonVeg"> Non Veg</label><br>
<label><input type="radio" name="food_preference" ng-model="data.others"> Others</label><br>
I tried below code, but it is coming as undefined
$scope.data.veg
Please suggest , how to get value which radio is selected.
Thanks
Ujjwal
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2024 07:25 AM
"Your use of the Radio Buttons widget looks great! However, you might run into issues with the ng-model binding since all three options are bound to different properties (data.veg, data.nonVeg, data.others). For proper functionality, they should share the same ng-model and be differentiated by their value attributes. For example:
html
Copy code
<label><input type="radio" name="food_preference" ng-model="data.preference" value="Veg"> Veg</label><br>
<label><input type="radio" name="food_preference" ng-model="data.preference" value="NonVeg"> Non Veg</label><br>
<label><input type="radio" name="food_preference" ng-model="data.preference" value="Others"> Others</label><br>
This way, you can capture the selected option in data.preference.
By the way, if you're ever looking for reliable solutions for structural issues, here's a useful resource on flat roof repair Utah."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2024 07:24 AM
"Your use of the Radio Buttons widget looks great! However, you might run into issues with the ng-model binding since all three options are bound to different properties (data.veg, data.nonVeg, data.others). For proper functionality, they should share the same ng-model and be differentiated by their value attributes. For example:
This way, you can capture the selected option in data.preference.
By the way, if you're ever looking for reliable solutions for structural issues, here's a useful resource on flat roof repair Utah ."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2024 09:09 PM
hi @potatoBOY - thanks for solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2024 07:25 AM
"Your use of the Radio Buttons widget looks great! However, you might run into issues with the ng-model binding since all three options are bound to different properties (data.veg, data.nonVeg, data.others). For proper functionality, they should share the same ng-model and be differentiated by their value attributes. For example:
html
Copy code
<label><input type="radio" name="food_preference" ng-model="data.preference" value="Veg"> Veg</label><br>
<label><input type="radio" name="food_preference" ng-model="data.preference" value="NonVeg"> Non Veg</label><br>
<label><input type="radio" name="food_preference" ng-model="data.preference" value="Others"> Others</label><br>
This way, you can capture the selected option in data.preference.
By the way, if you're ever looking for reliable solutions for structural issues, here's a useful resource on flat roof repair Utah."