2
j0n4s
6y

Why do i need javascript to post html tables?

Comments
  • 4
    You don't
  • 0
    @Kimmax But my inputs have the same name for each row and it overrides it everytime. So i just get the last row...
  • 0
    Depends on how complex the forms are. Javascript in forms is great for:

    - Curated User Journeys

    - Multistage forms

    - Intuitive Feedback (errors etc)

    - Interactive form elements such as progress bars.

    React a good tool for these kinds of forms.

    If you don't need any of the above: HTML forms have some basic features like generic validators and HTML5 inputs that can get you a decent way.
  • 0
    I have 4 inputs in each row and i want to be able to remove and add rows. But they all have the same names. So in the PHP Post array is just the last row.
  • 1
    Ok I think before you start adding interactive behaviour you need a good understanding of HTML5 forms.

    https://developer.mozilla.org/en-US...

    https://www.w3schools.com/Html/
  • 1
    @jonjoe Uhm i know html forms well i work very often with them and i know the problem but my Browser posts it like that and php receives it as "Array ( [event] => test2 [current] => test2 [need] => test2 [person] => test2 )"
  • 0
    Need to see the code. Throw it into a Gist.
  • 2
    Use square brackets in name example <input type='text' name='event[] ' /> then you'll get all values as separate arrays in post
  • 0
    @segfaults thanks thats what i need
Add Comment