hades300's avatar

Dynamic input array dont submit.

Hi, i put function on my website so user can dynamically add input array.For some reason it doesnt submit it with form.When i tried on basic PHP project it works fine but for some reason it doesnt work on Laravel.When i type dd(Request:all()); it doesnt show there it only submits if input is put in code and not dynamically with Jquery. Here is the code i use for jquery.

Here is code i use: https://jsfiddle.net/gj93yq4f/9/

0 likes
10 replies
Cronix's avatar

It should work fine, as long as it gets added within the <form> tags. I do it all the time.

1 like
Cronix's avatar

I don't know what to tell you. I've used jquery to dynamically add form elements and they work fine, as long as they have the name attribute and are within form tags. Maybe show the actual code you're using.

1 like
Cronix's avatar

can somehow problem be with enctype="multipart/form-data"?

No, that shouldn't matter for adding form inputs.

1 like
Cronix's avatar

What about the javascript you're using to generate the form elements and put them in the form? The view looks ok.

1 like
hades300's avatar
hades300
OP
Best Answer
Level 1

If you ever encounter with this here is little help from me.I spent like 3-4 days tying to solve this and finally i find the way.I have to change whole website structure but when i put form tag before everything it works..I dont know why, but if you ever encounter with this stupid problem here is the way to solve this.

1 like
Cronix's avatar

I have to change whole website structure because when i put this before every input in form it works fine.

Put what before every input? You don't show what you did to solve this.

1 like

Please or to participate in this conversation.