Simple HTML User Input and Process Output

W

W. D. Allen Sr.

Does anyone have a simple HTML example of a user input of two numbers into a
form and the display of the product of the two numbers?

I'm just an HTML "nubie".

Thanks,

WDA
(e-mail address removed)


end
 
D

David Dorward

W. D. Allen Sr. said:
Does anyone have a simple HTML example of a user input of two numbers into
a form and the display of the product of the two numbers?

HTML doesn't provide such a facility, the reliable way to achieve such a
thing is to provide a form with two input elements of type text, and one of
type submit.

http://www.w3.org/TR/html4/interact/forms.html

Then write a form handler in the server side language of your choice to
perform the addition. The specifics of such depend on the capabilities of
your server. http://www.cgi101.com/learn/ gives a basic introduction to the
principles of writing CGI scripts in Perl.

You could also look at client side JavaScript, but it is bad practise to
depend on it and it should usually only be considered as a convenience to
the user (e.g. to duplicate work that a server side program is already in
place to perform).
 
T

Toby Inkster

W. D. Allen Sr. said:
Does anyone have a simple HTML example of a user input of two numbers into a
form and the display of the product of the two numbers?

You'll need to use a scripting language for that. Here's an example using
a blend of Javascript and PHP (works with Javascript for those people with
Javascript-enabled browsers, but falls back to PHP when Javascript is not
available):
http://examples.tobyinkster.co.uk/multiply.php
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top