Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   add text fields together... (http://www.velocityreviews.com/forums/t391688-add-text-fields-together.html)

blackjack 11-28-2006 03:48 PM

add text fields together...
 
Hi,

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.

Cheers
bj



Toby Inkster 11-28-2006 04:25 PM

Re: add text fields together...
 
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



All times are GMT. The time now is 12:36 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.