CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 button - onclick - JavaScript - DOES NOT WORK!!!

Print topic Send  topic

Author Message
RoyBaird

Posts: 115
Posted: 07/29/2006, 9:25 PM

I am going nuts!!!! I have several listboxes with choices for High, Medium or Low (H, M, L). I am using "switch" to assign a value to a variable based on the value of the listboxes. I want to press the button and have the calculated value appear in another textbox. I get nothing in then textboxes and no errors. here is the code:

function page_DI_calc_Button1_OnClick()
{
var result;
//End page_DI_calc_Button1_OnClick

//Custom Code @31-2A29BDB7
// -------------------------
// Write your own code here.

var a1 = 0.0;
var a2 = 0.0;
var a3 = 0.0;
var a4 = 0.0;
var b1= 0.0;
var b2= 0.0;
var b3= 0.0;
var b4= 0.0;
var b5= 0.0;
var b6= 0.0;
var c1= 0.0;
var c2= 0.0;
var c3= 0.0;
var c4= 0.0;
var c5= 0.0;


switch (DI_calc.Breakeven_time.value) {
case "H": a1 = 3.0; break;
case "M": a1 = 1.5; break;
case "L": a1 = 1.0; break;
default: a1 = 0.0;
}

switch (DI_calc.Bus_opportunity.value) {
case "H": a2 = 3.0; break;
case "M": a2 = 1.5; break;
case "L": a2 = 1.0; break;
default: a2 = 0.0;
}

switch (DI_calc.Savings_level.value) {
case "H": a3 = 3.0; break;
case "M": a3 = 1.5; break;
case "L": a3 = 1.0; break;
default: a3 = 0.0;
}

switch (DI_calc.Investment_level.value) {
case "H": a4 = 3.0; break;
case "M": a4= 1.5; break;
case "L": a4 = 1.0; break;
default: a4 = 0.0;
}

switch (DI_calc.Resource_requirements.value) {
case "H": b1 = 3.0; break;
case "M": b1 = 1.5; break;
case "L": b1 = 1.0; break;
default: b1 = 0.0;
}

switch (DI_calc.Single_Cross_ops.value) {
case "H": b2 = 3.0; break;
case "M": b2 = 1.5; break;
case "L": b2 = 1.0; break;
default: b2 = 0.0;
}

switch (DI_calc.Time_to_deliver.value) {
case "H": b3 = 3.0; break;
case "M": b3 = 1.5; break;
case "L": b3 = 1.0; break;
default: b3 = 0.0;
}

switch (DI_calc.Impact_change.value) {
case "H": b4 = 3.0; break;
case "M": b4 = 1.5; break;
case "L": b4 = 1.0; break;
default: b4 = 0.0;
}

switch (DI_calc.Single_multi.value) {
case "H": b5 = 3.0; break;
case "M": b5 = 1.5; break;
case "L": b5 = 1.0; break;
default: b5 = 0.0;
}

switch (DI_calc.Interdependencies.value) {
case "H": b6 = 3.0; break;
case "M": b6 = 1.5; break;
case "L": b6 = 1.0; break;
default: b6 = 0.0;
}

switch (DI_calc.Risk_clients.value) {
case "H": c1 = 3.0; break;
case "M": c1 = 1.5; break;
case "L": c1 = 1.0; break;
default: c1 = 0.0;
}

switch (DI_calc.Risk_new_tech.value) {
case "H": c2 = 3.0; break;
case "M": c2 = 1.5; break;
case "L": c2 = 1.0; break;
default: c2 = 0.0;
}

switch (DI_calc.Time_pressure.value) {
case "H": c3 = 3.0; break;
case "M": c3 = 1.5; break;
case "L": c3 = 1.0; break;
default: c3 = 0.0;
}

switch (DI_calc.Bus_impact_not.value) {
case "H": c4 = 3.0; break;
case "M": c4 = 1.5; break;
case "L": c4 = 1.0; break;
default: c4 = 0.0;
}

switch (DI_calc.Change_direction.value) {
case "H": c5 = 3.0; break;
case "M": c5 = 1.5; break;
case "L": c5 = 1.0; break;
default: c5 = 0.0;
}



DI_calc.Financial.value = ((a1+a2+a3+a4)*5/12))
DI_calc.Complexity.value = ((b1+b2+b3+b4+b5+b6)*5/18))
DI_calc.Risk.value = ((c1+c2+c3+c4+c5)*5/15))
// -------------------------
//End Custom Code

//Close page_DI_calc_Button1_OnClick @30-BC33A33A
return result;
_________________
Roy
View profile  Send private message
RoyBaird

Posts: 115
Posted: 07/29/2006, 10:28 PM

got it to work...
_________________
Roy
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.