Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

nodejs store selected dropdown in variable

var selectedValue = user.schoolType;

<select class="form-control" id="schoolType" name="schoolType" value="
{{user.schoolType}}">

  <option value="none" selected="{{user.schoolType === 
this.value}}">None</option>
<option value="public" selected="{{user.schoolType === 
this.value}}">Public</option>
<option value="private" selected="{{user.schoolType === 
this.value}}">Private</option>
<option value="homeSchool" selected="{{user.schoolType === 
this.value}}">Home School</option>
 </select>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #nodejs #store #selected #dropdown #variable
ADD COMMENT
Topic
Name
8+7 =