HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignHTML Programming

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 Dev Shed Forums Sponsor:
  #1  
Old June 9th, 1999, 10:24 AM
drosen
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I am interested in having two drop down lists on a page so a person can select a country from each list, click submit, and a phone rate will be automatically calculated and displayed for the user.

Any help would be completely appreciated.

- Damien

------------------
www.international01.com

Reply With Quote
  #2  
Old June 10th, 1999, 08:27 AM
christine
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
URLI've used this script, to do a similar calculation, and I think it'll do for you.

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--hide code from old browsers
function get_rate ()
{
if (document.rates.from.options[document.rates.from.selectedIndex].value !="none")
{
if (document.rates.to.options[document.rates.to.selectedIndex].value !="none")
{
var rate_from = eval(document.rates.from.options[document.rates.from.selectedIndex].value);
var rate_to = eval(document.rates.to.options[document.rates.to.selectedIndex].value);
var rate = eval(rate_from + rate_to);
alert("Call costs $"+rate+" per minute");
}
else
{
alert("Please select countries.");
}
}
else
{
alert("Please select countries.");
}
}
//end hiding-->
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="rates">
<SELECT NAME="from" SIZE="1">
<OPTION VALUE="none">calling from
<OPTION VALUE="0.10">country 1
<OPTION VALUE="0.20">country 2
<OPTION VALUE="0.30">country 3
<OPTION VALUE="0.40">country 4
</SELECT>
<SELECT NAME="to" SIZE="1">
<OPTION VALUE="none">calling to
<OPTION VALUE="0.10">country 1
<OPTION VALUE="0.20">country 2
<OPTION VALUE="0.30">country 3
<OPTION VALUE="0.40">country 4
</SELECT>
<BR>
<INPUT TYPE="button" VALUE="calculate rate" onClick="get_rate()">
</FORM>
</BODY>
</HTML>

Hope it helps.
Christine.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > drop down lists

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap