Skip to content
Advertisement

how to send jquery dynamic data to controller

guys I’m new to jquery as well as javascript. I want to make an application in laravel where I have to add product and their detail dynamically. So I tried Jquery first time. I got Jquery code but now I can’t get how these values pass through the controller So please help me out with this. Thank You

This is my jquery code

JavaScript

how to get this value in the controller?

Advertisement

Answer

I suggest you to use bootstrap modal foe this, When you click on the button add_new_frm_field_btn, bootstrap modal will appears and in this modal you change according your requirements.

see example below and try to do this,

JavaScript

Write script for select2 functionality,

JavaScript

for using bootstrap you have to mentioned below scripts in your file,

JavaScript

You can create form in this modal and mentioned method post, route too and when you try to click on submit button it will go to the controller file and there you can try to get all parameters.

for more bootstrap modal options go through this link Bootstrap4

in your route.php file

JavaScript

in your controller file

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement