/    Sign up×
Community /Pin to ProfileBookmark

submit a form…and DOM..helpp

hello all…
i am creating some input text fields with DOM..
and i pass them into a .php file..
that the user is able to create and delete on the fly as many elements as he want…the problem is how to pass the value in php file…
if i put the name as:name=fields_name[+num+]
the user may create for example 5 fields…but by creating and deleting the fields my fields_name[] table possibly will come in this situation…
first field:name=fields_name[4]
second field:name=fields_name[9]
third field:name=fields_name[10]
fourth field:name=fields_name[15]
fifth field:name=fields_name[17],

but i want to pass in php the correct order…
first field:name=fields_name[1]
second field:name=fields_name[2]
third field:name=fields_name[3]
fourth field:name=fields_name[4]
fifth field:name=fields_name[5]

i am very sorry for my english but it is very hard for me to explain..

which is the best way to do it???

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@FangMar 16.2009 — Don't number them; the array [I]fields_name[/I] is passed in order to the server script.
Copy linkTweet thisAlerts:
@eleor_dauthorMar 16.2009 — what do you mean that it is passed in order to the server script?

could you please give an example or explain???
Copy linkTweet thisAlerts:
@FangMar 16.2009 — Try your form without the numbering and see the results obtained server side.
×

Success!

Help @eleor_d spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...