Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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:
  #1  
Old December 9th, 2005, 02:16 AM
sessionmedia sessionmedia is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: NY, USA
Posts: 19 sessionmedia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to sessionmedia
what am I doing wrong?

What is wrong with the code below?
I am trying to addup the number value from two dropdown boxes one called slots one called locations. However the below code just puts both $values in my price box not the total of the two??

<script language="JavaScript" type="text/JavaScript">
function MyChange(CalcPrice){
document.Form1.price.value = document.Form1.slots.value + document.Form1.locations.value;
MyCalc();
}
</script>

Reply With Quote
  #2  
Old December 9th, 2005, 04:21 AM
bakertrg's Avatar
bakertrg bakertrg is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Scottsdale AZ, US
Posts: 2,253 bakertrg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 48 m 45 sec
Reputation Power: 4
Send a message via Yahoo to bakertrg
RE: what am I doing wrong?

try eval()

Reply With Quote
  #3  
Old December 9th, 2005, 09:07 PM
sessionmedia sessionmedia is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: NY, USA
Posts: 19 sessionmedia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to sessionmedia
RE: what am I doing wrong?

ok I am still lost. I tried to look for some tutorials with no luck so maybe can someone show me the doe I would use or explain in further detail how I would add the number values of 2 or more form fields together into a third text box called total ??

Basiclly if I have two dropdown boxes that call various prices from a mysql dbase so dropdown box one has as choices:
1.00
2.00
3.00

and dropdown 2 has
5.00
6.00
7.00
(those are the prices pulled from the dbase)

How do I add the selected $price from each dropdown and display the total price in a textbox named total ??
Thanks all

Reply With Quote
  #4  
Old December 10th, 2005, 02:16 AM
bakertrg's Avatar
bakertrg bakertrg is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Scottsdale AZ, US
Posts: 2,253 bakertrg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 48 m 45 sec
Reputation Power: 4
Send a message via Yahoo to bakertrg
RE: what am I doing wrong?

what part of look up eval() are you not getting?

this forum is about us trying to help you learn to do it yourself. You need to do two things, one you need to have a trigger, in this case I recomend the onChange event handler so that when you change your list boxes the total is recalculated. the eval() method will add the two numbers together, so instead of saying "I don't get it and skpping past the fact I gave you the method you need" why don't you try and play with it and then let us know what you got.


Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > what am I doing wrong?


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT