Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 18th, 2004, 06:17 PM
Registered User
 
Join Date: Mar 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default If, else if statements

I am having a slight problem getting a fucntion to work. I have multiple function similar to this one running on one page. The purpose of these functions is to take a yes or no selection and populate other boxes with numbers and then add them up to a total. All of the function work except this one and I am stuck.

 
Code:
function EXTRAEMAILCOST(field){
Code:
   if(field.value==5) {
      document.PlanCost.EXTRAEMAIL.value="5";
      }
     else if(field.value ==4){
        document.PlanCost.EXTRAEMAIL.value="4";
       }
    else if(field.value ==3){
        document.PlanCost.EXTRAEMAIL.value="3";
       }
    else if(field.value ==2){
        document.PlanCost.EXTRAEMAIL.value="2";
       }
    else if(field.value ==1){
        document.PlanCost.EXTRAEMAIL.value="1";
       }
    else {
        document.PlanCost.EXTRAEMAIL.value="0";
       }

       var FTP = eval(document.PlanCost.FTP.value);
       var EMAIL = eval(document.PlanCost.EMAIL.value);
       var EXTRAEMAIL = eval(document.PlanCost.EXTRAEMAIL.value);
       var SQL = eval(document.PlanCost.SQL.value);
       var DOMAIN = eval(document.PlanCost.DOMAIN.value);
         document.PlanCost.TOTAL.value=FTP+EMAIL+EXTRAEMAIL+SQL+DOMAIN + "." + "00";
}
Does anyone have any ideas?

Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if statements brainchild Javascript 2 March 1st, 2007 06:08 AM
If Then Statements in XSL deltree XSLT 2 June 6th, 2006 03:02 PM
Openquery statements aven SQL Server 2000 2 January 11th, 2006 01:33 AM
Case Statements cfriedberg SQL Server 2000 1 September 7th, 2005 08:46 PM
IF ELSE statements gmpurple Classic ASP Databases 4 November 15th, 2004 04:30 PM



All times are GMT -4. The time now is 03:43 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.