/    Sign up×
Community /Pin to ProfileBookmark

Hard problem on forms and JS

Hey there folks. I have a task regarding forms and JavaScript. I’ve been reading for the past couple of weeks, but didn’t find a popper solution to the task, here it is:

I have a form. Once the user clicks on the first <select> menu, second <select> menu must appear. After the user has clicked on the second <select> menu a final input field must appear. It goes like this:

Choose car type: car1,car2,car3…carN

After the user has chosen car type: engine1,engine2,engine3…engineN

After the user has chosen the engine: the price of the car appears.

After all of the inputs are completed a script takes the data and sends them to a given mail.

I’ve had some success with usableforms(quirksmode), but I don’t know how to “extract” the price, since there are a lot of fields. Any suggestions are welcome.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@FangMar 01.2010 — Sounds like you are using mailto rather than a server-side script where you wouldn't have the problem.

Post the document or a link
Copy linkTweet thisAlerts:
@dig1tyauthorMar 01.2010 — http://treniram.com/ins/jstest.html Here is the test page. It only uses JS for the Usable Forms. I haven't got to the point where I need the data, I don't know how to get the data from the 3rd input field.
Copy linkTweet thisAlerts:
@FangMar 01.2010 — document.getElementById('lname').value
// or
document.forms[0].lname.value
×

Success!

Help @dig1ty 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.27,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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