You are here: Re: add text fields together... « HTML « IT news, forums, messages
Re: add text fields together...

Posted by Toby Inkster on 11/28/06 16:25

blackjack wrote:

> I'd like to use 2 text fields, and a button that when clicked , would add
> the 2 fields together and display as a line of text, can anyone help with
> this.

<form method="get" action="<?= $_SERVER['PHP_SELF'] ?>"
onsubmit="this.c.value=Number(this.a.value)+Number(this.b.value);
return false;">
<fieldset>
<legend>Add things</legend>
<input name="a" value="<?= (real)$_GET['a'] ?>"> +
<input name="b" value="<?= (real)$_GET['b'] ?>">
<input type="submit" value="=">
<input name="c" value="<?= (real)$_GET['a'] + (real)$_GET['b'] ?>">
</fieldset>
</form>

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация