How to pass multiple values through Ajax in laravel?

Posted 11 months ago by AbdulBazith

I am having form view.blade which shows the data of all sales_details (my table) in tabular format.

I am having three text boxes in my view.blade which I am using for search option.

This is my view.blade (just I copied the search box code only)


            <th > {{ Form::text('search_name',null,array('class'=>'form-control','id'=>'search_name','name'=>'search_name')) }}</th>
            <th> {{ Form::text('search_area',null,array('class'=>'form-control','id'=>'search_area','name'=>'search_area')) }}</th>
            <th> {{ Form::text('search_booth',null,array('class'=>'form-control','id'=>'search_booth','name'=>'search_booth')) }}</th>


This is my JavaScript




type : 'get',

url : '{{URL::to('search_name')}}',









This is my controller

public function search_name( Request $request )



        //Need to return the output to the ajax
        // Need to perform some thing

My doubt is I am writing the JavaScript in onkeyup event for the textboxes. I have entered some text in first text box and some text in second textbox an when I enter content in third textbox the ajax should fetch all the three content from three text boxes and it should pass to the function search() in the controller. [Will be better if any of the textbox is gets the onkeyup event the same ajax function must be called how?]

Then another doubt is after passing the three content those three must be used to where conditions in the function.

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

Reply to

Use Markdown with GitHub-flavored code blocks.