/    Sign up×
Community /Pin to ProfileBookmark

DIV tag FOrm element problem

Hello,

I have a FORM that contains many DIV tags and each DIV tags I have some FORM INPUT ELEMENTS.

When I try to access the form elements through java script, I am unable to set values to the form elements. that is because of DIV tag only.

I have to set values like this,

document.formName.elementName.value=”something”;

I am able to set values using some other ways. But I need to use the way i mentioned here, because I am using a third party date picker javascript. that accepts an input parameter of ‘formname.elementName’ format;

please let me know, how to do it..

thanks in advance
-Mathews

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisAug 11.2008 — Your HTML is probably broken. If your HTML is valid, you should always be able to address the form elements as you have indicated.
Copy linkTweet thisAlerts:
@mathewsjohnauthorAug 11.2008 — I dont know what happend with it. same this will work fine, if I just remove the DIV tag and do the same, so I thought it is a problem with DIV tag,

i cheked with the HTML and it is not broken..

Thanks,

-Mat
×

Success!

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