/    Sign up×
Community /Pin to ProfileBookmark

Forms ? basic math

There is a “Form” site that I started using, (from a link on the HTML Goodies site).
I did a test form just to see how it works. In that form the calulations are performed right on the page, I was wondering how that is done:
[url]http://www.formdesk.com/epourania/test02[/url]

I looked at the code, but I can’t figure it out.
Is that some special scripting? or can that be done in vanilla HTML?

to post a comment
Full-stack Developer

2 Comments(s)

Copy linkTweet thisAlerts:
@AdamGundryJul 31.2004 — You need a scripting language of some kind to do this, because plain HTML is for markup only. In this case, JavaScript has been used - it is the most common client-side language available. In general, however, the need to make sure users with JavaScript disabled can use your site means you should often use a "server-side" language such as PHP or Perl instead, with JavaScript used to improve usability where possible.

As for that page's code, I wouldn't want to figure it out either - there seems to be a lot of unnecessary extra code present. You can achieve something like that in JS with only a few lines of code.

Adam
Copy linkTweet thisAlerts:
@anothenauthorJul 31.2004 — Thanks Adam, I'm transferring this post to javascripting.

I've been attempting to learn the code, I'm still trying to figure it out.
×

Success!

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