【发布时间】:2022-12-19 15:05:30
【问题描述】:
我想使用 ajax 创建一个独立的下拉列表,我尝试使用 onchange、onclick、onfocus、事件,但似乎没有任何效果。我对此进行了很多搜索,但所有解决方案都在动态相关的下拉列表中。但我想要一个在单击下拉菜单时显示数据的解决方案。任何建议/帮助将不胜感激。谢谢。
表单.blade.php
<div class="form-group">
<label for="brandName">Brand Name/Distributor *</label>
<p>Provide Brand Name or Distributor name here</p>
<select class="custom-select brand" id="brand" name="brand_name" aria-label="">
<option></option>
</select>
</div>
脚本.js
$("#brand").focus(function(){
alert('Change Happened');
});
【问题讨论】:
标签: php jquery ajax laravel dropdown