jquery data input validation min and max in number
<td align='right'>
<label for="decimal"> <?php echo form_error('price') ?></label>
<input style="background-color:#FFFF42" type="text" class="form-control" name="price" id="price" placeholder="price" value="<?php echo $price; ?>" />
</td>
<script type="text/javascript">
$('#price').keyup(function(){
if ($(this).val() > 20 ){
alert("Price Max USD. 20");
$(this).val('20');
}
else if {
($(this).val() < 5 ){
alert("Price Min USD. 5");
$(this).val('5');
}
});
</script>
but this doesn't work there is no action