|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Auto Generating values without clicking buttons
Hi there!
I have a field which allows user to input the cost of a training course. I want the TOTAL COST (including additional charge) to be automatically generated in the next field WITHOUT clicking any sumbit buttons! Below is a section of my codes, please advice. Thank you! <input name="CourseFee" type="text" size="5"> <?$Fee=$_GET['CourseFee'];> $Total = $Fee*1.05;?> <input name="CourseFeeTotal" type="text" size="5" value="<?=$Total?>"> |
|
#2
|
|||
|
|||
|
Message Moved
Thread moved from 'PHP Coding' to 'Client Side Things' by notepad.
Reason: php won't execute without reloading the page |
|
#3
|
|||
|
|||
|
RE: Auto Generating values without clicking buttons
As noted above, you'll need to use a client side method(javascript) for this. Here is a very basic beginning:
Code:
<form name="upd" id="upd"> <input type="text" name="subtotal" id="subtotal" onchange="document.upd.total.value=parseFloat(this.value)*1. 05;"><br /> <input type="text" name="total" id="total" disabled="true"><br /> </form> From here you'll need to come up with a rounding function, and depending on your needs, a fuction to update the value as you type it, as opposed to having to tab/click out. Do some searching, and you'll surely find some premade functions. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Auto Generating values without clicking buttons |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|