【发布时间】:2017-09-28 00:25:47
【问题描述】:
我编写了一个程序来在用户在文本框中输入值时更改字段的值。在我的情况下,两个文本框是高度和宽度。当有人输入高度和宽度时,应显示相关价格。我会把我的代码写在下面。
<div class="form-group">
<div class="col-sm-9">
<input type="text" id="height" />
<input type="text" id="width" />
<button type="button" id="show">Enter Size</button>
<button type="button" id="hide">Hide</button>
<script> jQuery('height').on('input', function() {
<?php echo "hello" ?>
});
function()
{
<input id="post_price" type="hidden" name="price" value="<?=$price['price'];?>">
}
</script>
</div>
</div>
【问题讨论】:
标签: jquery event-handling textchanged