This is a discussion on "Unable to multiply without pressing button" within the JavaScript Forum section. This forum, and the thread "Unable to multiply without pressing button are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Unable to multiply without pressing button
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Unable to multiply without pressing button
Dear friends,
I have two textboxes <input type="text" name="price" size="20"> <input type="text" name="quantity" size="20"> In the price textbox the price is already entered. I want to automatically calculate total price by multiplying price * quantity without pressing of calculate button (if one entered 1 in quantity it will automatically get multiplied with price and get entered into third box, if it adds 0 with 1 i.e. 10 it target box autmatically updated). It should also checkthe quantity only contain number. I have trried a lot but failed. Please give any hint idea or code. Thanks |
|
|
|
#2
|
||||
|
||||
|
Re: Unable to multiply without pressing button
what about calling the function onChange()
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#3
|
||||
|
||||
|
You could right a function that is called onchange or onkeyup in the quantity box.
It can do the checking for you
Cheers,
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Send variable by pressing hyperlink? | skuliaxe | PHP Forum | 9 | Feb 6th, 2008 18:02 |
| unable to set padding | tox0tes | Web Page Design | 5 | Jul 1st, 2007 16:45 |
| [XSLT]: Recursive Function to Add/Multiply | ThyGizmo | Other Programming Languages | 0 | Oct 9th, 2006 08:15 |
| Two form actions on pressing submit button? | AndyP | Web Page Design | 7 | Jul 25th, 2005 16:25 |
| Unable to get correct leading | Audioz | Web Page Design | 4 | Nov 14th, 2004 19:32 |