/    Sign up×
Community /Pin to ProfileBookmark

build an order form with javascript

I ‘m complete new with javascript, but I’m used to php.
I would like to write my first javascript and need some hints.

This is the form:

total1=quantity1*10
total2=quantity1*
15
total3=quantity1*20
total=total1+total2+total3

[QUOTE]

<form>
<input type=”text” name=”quantity1″ value=”” size=”5″ />
item1 for 10$
makes
<input type=”text” name=”total1″ value=”” size=”5″ />
<p>
<input type=”text” name=”quantity2″ value=”” size=”5″ />
item2 for 15$ makes
<input type=”text” name=”total2″ value=”” size=”5″/>
</p>
<p>
<input type=”text” name=”quantity3″ value=”” size=”5″ />
item3 for 20$ makes
<input type=”text” name=”total3″ value=”” size=”5″ />
</p>
<p>Total
<input type=”text” name=”total” value=”” size=”5″ />
</p>
</form>

[/QUOTE]

On the total1, total2, total3 and total textarea the multiplication should be print (echo) when a quantity is entered. Also the total should be displayed. Can you give me an hint?

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @paldo 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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