Hi I want to do a simple angularjs filter so I have this:
<input type="text" id="name" style="display:block" class="form-control" placeholder="By name" ng-model="search.student_name">
<input type="text" id="code" style="display:none" class="form-control" placeholder="By code" ng-model="search.student_code">
<input type="text" id="room" style="display:none" class="form-control" placeholder="By room" ng-model="search.student_room">
<select name="filter" id="filter">
<option value="name">Name</option>
<option value="code">Code</option>
<option value="room">Room</option>
</select>
and the test script (doesn't works... Jquery conflict)
<script type="text/javascript">
if(document.getElementbyId('filter').value === 'code'){
document.getElementbyId('name').style.display="none";
document.getElementbyId('code').style.display="block";
};
</script>
The question is: there is another way to show and hide the selected input? Can I do it on the server-side?
ifstatement, you are comparing value withcodigo. But there is nothing like that. It should becode, I suppose.