【问题标题】:Populate independent dropdown using jquery ajax使用 jquery ajax 填充独立下拉列表
【发布时间】: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


    【解决方案1】:

    你可以按照这篇文章来实现依赖下拉

    这是链接:https://codelapan.com/post/how-to-create-a-dropdown-dependent-in-laravel-8-with-jquery-ajax

    【讨论】:

      猜你喜欢
      • 2012-11-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多