HTML
<div class="form-group">
<label class="col-md-4 control-label">input price</label>
<div class="col-md-8">
<input class="form-control" placeholder="price" id='price'>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Range</label>
<div class="col-md-8">
<select class="form-control" disabled="disabled" name='range'>
<option value=1>150.000</option>
<option>200.000</option>
<option>250.000</option>
<option>300.000</option>
<option>350.000</option>
<option>400.000</option>
<option>450.000</option>
</select>
</div>
</div>
jQuery script:
<script>
$$(document).ready(function($){
$("#price").mask("999.000");
$("#price").on('keyup', function() {
var price = $("#price").val();
if(price <= 150000)
{
$('#range').val(150000);
}
});
});
</script>
Hello guys, what Im trying to do is .. When I write the price (it has a mask), so only need to type the 3 first number, the ".000" is set automatically. So when a number is type I check the entered value, then depending of that price value I will like to change the #range value that is a select.
The select is disabled cause It will be set depending of the value is inserted on the price. 0-150000 , 150001-250000, 250001-3500001.. on and on
Its like if y type DOG, automatically the select would be set on Animals
pricein place ofprecio, Please confirm that.