/    Sign up×
Community /Pin to ProfileBookmark

Send Dynamic data to js function

My application contains few Dynamic forms called FormX (when X is the number of the forum)

Here is my simple function:
function MessageCodeA(NumForm){

if (eleNum==NumForm){
form_NumForm.recepitmain.value +=”<br>”;
}
else if (eleNum==NumForm){
form_NumForm.recepitmain.value +=”<br>”;
}
}

How do I pass the value to the Form when the Form name changes dynamically.

10x

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@NevermoreAug 01.2003 — If it is only the form name that changes, then you could refer to the inputs by id. Otherwise you will have to store a variable with the id (or whatever), and use it in place of the id in your code.
×

Success!

Help @shvoong 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,
)...