SunQuest
           Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Try It Free
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
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  
Old March 23rd, 2004, 10:16 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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?>">

Reply With Quote
  #2  
Old March 23rd, 2004, 11:36 AM
System System is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Posts: 665 System User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Message Moved

Thread moved from 'PHP Coding' to 'Client Side Things' by notepad.

Reason: php won't execute without reloading the page

Reply With Quote
  #3  
Old March 23rd, 2004, 07:27 PM
brut brut is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 367 brut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 30 sec
Reputation Power: 2
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.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Auto Generating values without clicking buttons


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Try It Free




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway