2 years ago

how to pass dynamic selector value to jquery

Posted 2 years ago by bipin

Hello guys here, i m trying to get dynamic input id value into jquery here is my view

                       <select class="selectpicker form-control " id="applicantstatus[{{$s->id}}]" name="applicantstatus[{{$s->id}}]" data-style="btn-info btn btn-xs" data-posttd="{{$s->id}}" data-width="auto" >  <option >Select</option>
                                  <option   value="Processing" >Processing</option>     
                                  <option   value="Hired">Hired</option>
                                  <option   value="Reject">Rejected</option>
                                  <option   value="RollBack">RollBack</option>
                                <td class="text-right footable-visible footable-last-column">
                                        <a class="btn-success btn btn-xs setvalue" data-id="{{$s->id}}">Save</a>


here is my script

                           <script type="text/javascript">
    $(document).ready(function() {
   $('.setvalue').on('click', function() {
       var id = $(this).attr("data-id");
       var new1 = id;
        var inp =  $('#applicantstatus[new1]').val();


Please sign in or create an account to participate in this conversation.