0
Good morning, I would like to create a code where I have a select with various options and when one of them is selected and the user gives Submit, the string of this option is passed to a variable, can you help me? in the case of the code below I tried to use the angular but I am still beginner, can use any language to select , thank you
<form class="form" method="post" action="date.php">
<br>
<div class="input-group">
<div class="input-group-btn">
<input class="btn" type="submit">
</div>
<input type="month" class="form-control" name="datac" value="<?php echo $ano ?>-<?php echo $mes ?>" required>
<div ng-app="myApp" ng-controller="myCtrl">
<select ng-model="uni">
<option value="BRAZIL" ng-selected="uni=='BRAZIL'">BRAZIL</option>
<option value="USA" ng-selected="uni == 'USA'">USA</option>
<option value="CANADA" ng-selected="uni == 'CANADA'">CANADA</option>
<option value="RUSSIA" ng-selected="uni == 'RUSSIA'">RUSSIA</option>
</select>
Have you come to take a look at Knockoutjs
– Guto
No, I’ll look now
– Nikk 17016
Hello, I don’t quite understand your question. Do you simply want the value selected in the form to be passed to the server? or the value of select being a javascript variable for later use? you already use angular in your project or inserted it only for this functionality?
– mrlew
Calm down, I tried to do angular but it didn’t work, forget the angular part, I want to select a select option and when I give Submit the value of this option goes to a php variable, got?
– Nikk 17016