Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 18th, 2004, 06:17 PM
Registered User
 
Join Date: Mar 2004
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?






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





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