当我输入价格 0 时,状态需要在 CodeIgniter 中显示缺货
when i enter Price 0 the status need show outstock in CodeIgniter
查看代码
当我输入价格 0 时,状态需要在 CodeIgniter
中显示库存
即,如果我在 status felid 中自动输入 0 的 amount felid 价格,则需要显示 outofstock 如果输入高于 0,则需要显示 instock
<div class="col-md-6">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">Price</span>
</div>
<input type="text" required class="form-control" name="product_price" aria-label="Amount (to the nearest dollar)">
<div class="input-group-append">
<span class="input-group-text">AED</span>
</div>
<div class="col-md-6">
<div class="input-group mb-3">
<div class="input-group-prepend">
<label class="input-group-text" for="inputGroupSelect01">Status</label>
</div>
<select class="custom-select" name="product_status" id="inputGroupSelect01">
<option value="In Stock">In Stock</option>
<option value="Out of Stock">Out of Stock</option>
</select>
</div>
</div>
有关 keyup() 的更多信息:-
$(document).ready(function() {
$('#otherCategory').keyup(function() {
if ($(this).val() == 0) {
$('#category').val(0);
} else if ($(this).val() > 0) {
$('#category').val(1);
}
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="text" id="otherCategory" name="otherCategory">
<select id="category" name="category">
<option value="">Please select</option>
<option value="0">Out Of STock</option>
<option value="1">In STock</option>
</select>
查看代码
当我输入价格 0 时,状态需要在 CodeIgniter
中显示库存
即,如果我在 status felid 中自动输入 0 的 amount felid 价格,则需要显示 outofstock 如果输入高于 0,则需要显示 instock
<div class="col-md-6">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">Price</span>
</div>
<input type="text" required class="form-control" name="product_price" aria-label="Amount (to the nearest dollar)">
<div class="input-group-append">
<span class="input-group-text">AED</span>
</div>
<div class="col-md-6">
<div class="input-group mb-3">
<div class="input-group-prepend">
<label class="input-group-text" for="inputGroupSelect01">Status</label>
</div>
<select class="custom-select" name="product_status" id="inputGroupSelect01">
<option value="In Stock">In Stock</option>
<option value="Out of Stock">Out of Stock</option>
</select>
</div>
</div>
有关 keyup() 的更多信息:-
$(document).ready(function() {
$('#otherCategory').keyup(function() {
if ($(this).val() == 0) {
$('#category').val(0);
} else if ($(this).val() > 0) {
$('#category').val(1);
}
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="text" id="otherCategory" name="otherCategory">
<select id="category" name="category">
<option value="">Please select</option>
<option value="0">Out Of STock</option>
<option value="1">In STock</option>
</select>