Level 70
@osho Can you show your controller code from where you send $catByUser data?
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am trying to get request data from my inputsID but it's rendering my data the wrong way, how do I fix this?
````"1min_price=max_price=search="what I am getting on dd($request->cat_id) instead of just the value for$cat_id```.
Inputs
<div style="display: inline-block; margin-top:12px; text-align: center;">
<input type="text" id="catID" value="{{$catByUser}}" hidden/>
<input type="number" id="minpriceID" min="0" class="form-control" style="margin: inherit;" placeholder="Min Price">
<input type="number" id="maxpriceID" min="0" class="form-control" style="margin: inherit;" placeholder="Max Price">
<input type="text" id="search" class="form-control" style="margin: inherit;" placeholder="search product by name">
<div style="margin-top:inherit;">
<button class="login-btn form-control" id="findBtn" style="margin: inherit; border-left: inset;"> <span class="fas fa-filter"></span> Filter</button>
</div>
</div>
<script>
$(document).ready(function(){
$("#findBtn").click(function(){
var cat = $("#catID").val();
var minprice = $('#minpriceID').val();
var maxprice = $('#maxpriceID').val();
var search = $('#search').val();
$.ajax({
type: 'get',
dataType: 'html',
url: '{{url('/productsCat')}}',
data: 'cat_id=' + cat + 'min_price=' + minprice + 'max_price=' + maxprice + 'search=' + search,
success:function(response){
console.log(response);
$("#productData").html(response);
}
});
});
});
</script>
Please or to participate in this conversation.