When I select an item from combobox, I want to populate appropriate form for user input. Is it possible? e.g. if a user selects 'Address' from combo box, I want to populate form with address fields else if user selects phone, want to populate form to enter phone details.
Asked
Active
Viewed 22 times
0
-
http://stackoverflow.com/questions/14976495/get-selected-option-text-with-javascript – akshay.s.jagtap Jun 09 '16 at 03:56
1 Answers
0
You should be able to detect the selected option in the combobox and load the appropriate form inside a div.
<select ng-model="combo">
<option value="address">Address</option>
</select>
<div id='form-area'></div>
<script>
// inside you angularjs controller
if($scope.combo === 'address') {
$('form-area').html('Form Code here...');
}
</script>

Anjul Garg
- 484
- 1
- 4
- 17