/    Sign up×
Community /Pin to ProfileBookmark

Help with form question names!

Hi i am new to Java Script so please forgive any ignorance. I use a contact form which is provided and hosted by a third party. The problem i have is for each field they have the name q[#] where the # is the question number, because of this i cant get any auto fill formula to work i.e. onClick=”this.value=this.form.q[8].value;” the error i get is in IE where it says “Error: ‘this.form.q.8’ is null or not an object”.

Could somebody please take the time to explain why this happens and whether there is a possible workaround.

Thanks in advance,

Tom ?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@FangNov 15.2007 — onclick="this.value=this.form.elements['q[8]'].value;"
Copy linkTweet thisAlerts:
@feddie1984authorNov 15.2007 — Thanks Fang, i really appreciate your help, works a treat.

Regards,

Tom
×

Success!

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