Is it possible for jquery to understand the elements of an array value coming from the html? ps: I do not know if it is correct to say that in html there is an array.
I am creating with html and jquery a dynamic input that is having the value of name
as if it were an array, adding 1 for each insertion;
name="nome=[]", name="nome=[1]", name="nome=[2]"...
This is to make it easier for PHP to select the data.
These created inputs are mirrored in another <fieldset>
.
I want to mirror the values
by calling the element by name
I got this using .keyup()
of jquery, but it works only for the first input, which in theory would be nome[]
.
FromthisIimagined,Itriedtocreateafortocalleachelementofthearray.Bytheway,thewayIthoughttheselectoronlystaysinnome[]
.
IputitintomyheadtomakeitlooklikeImightnotbeseeingotherwaystosortitout.Itriedtbmwith.click
onabutton,wherethevaluesoftheinputsofthefirst<fieldset>
copiedinthevaluesoftheinputsoftheother<fieldset>
,Ithoughtbecausetheybothhadthesamename.
Whatwouldbeindicated?
StudyCode-Edit#1
IntheJavaScriptparttwowaysarecommented,onesuggestedby@MatheusCubaandawayIdidbytaking#ID,butIwouldliketousethetagname
link