468,457 Members | 1,786 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,457 developers. It's quick & easy.

Math operation in html

Hello
I have a html page that I am trying to get data from an user input and
then I want to be ble to sum the data. I would sum mon-in and mon-out
to get mon-time. Then I would like to sum mon-time...fri-time to get
total time for the week.

<TD height="33" valign="top">
<input type="text" name="mon-in" size="7" maxlength="5"
value="00:00">
</TD>
<td valign="top">
<input type="text" name="mon-out" size="7" maxlength="5"
value="00:00">
</td>
<TD valign="top">
<input type="text" name="mon-time" size="7" maxlength="5"
value="00:00">
</TD>

I appreciate any help and feedback.

Thanks
Mike
Jul 23 '05 #1
3 3800

"mikecantrell" <hu***********@bcbsla.com> wrote in message
news:2a*************************@posting.google.co m...
Hello
I have a html page that I am trying to get data from an user input and
then I want to be ble to sum the data. I would sum mon-in and mon-out
to get mon-time. Then I would like to sum mon-time...fri-time to get
total time for the week.


HTML doesn't do this--it's not a programming language. If you want the sum
to appear immediately after the user has entered the addends, you need to
learn client-side programming. Get yourself trained on Javascript. But first
make sure you can count on all your users *having* Javascript available in
their browsers. If they don't, you're out of luck.

Jul 23 '05 #2
On 4 Oct 2004 07:26:20 -0700, mikecantrell <hu***********@bcbsla.com>
wrote:
Hello
I have a html page that I am trying to get data from an user input and
then I want to be ble to sum the data. I would sum mon-in and mon-out
to get mon-time. Then I would like to sum mon-time...fri-time to get
total time for the week.


Impossible without scripting. I recommend using a form and a server-side
script to return the result.
Jul 23 '05 #3
In our last episode,
<2a*************************@posting.google.com> ,
the lovely and talented mikecantrell
broadcast on comp.infosystems.www.authoring.html:
Hello
I have a html page that I am trying to get data from an user input and
then I want to be ble to sum the data. I would sum mon-in and mon-out
to get mon-time. Then I would like to sum mon-time...fri-time to get
total time for the week.
You cannot do this with html. The "ml" means markup language. Html
has no math functions. Indeed, since it is just markup, html has no
functions of any kind.

You have essentially two options: a server-side solution (e.g. cgi)
or a client-side solution such as javascript. In either case, you
will generate or rewrite an html document with the answers you want,
but html won't do the work.

<TD height="33" valign="top">
<input type="text" name="mon-in" size="7" maxlength="5"
value="00:00">
</TD>
<td valign="top">
<input type="text" name="mon-out" size="7" maxlength="5"
value="00:00">
</td>
<TD valign="top">
<input type="text" name="mon-time" size="7" maxlength="5"
value="00:00">
</TD> I appreciate any help and feedback. Thanks
Mike

--
Lars Eighner -finger for geek code- ei*****@io.com http://www.io.com/~eighner/
If it wasn't for muscle spasms, I wouldn't get any exercise at all.
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Wernfried Schwenkner | last post: by
12 posts views Thread by Janiek Buysrogge | last post: by
15 posts views Thread by Morgan Cheng | last post: by
reply views Thread by kirby.urner | last post: by
5 posts views Thread by Yansky | last post: by
13 posts views Thread by =?Utf-8?B?RXRoYW4gU3RyYXVzcw==?= | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by subhajit12345 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.