Forum Moderators: open
function omg1()
{
parent.top.framename.functionname();
}
Gives me the err:
Object doesn't support this property or method
Here is the code as viewed source:
<HTML>
<head>
<title>THE SEXTANT</title>
<link rel="stylesheet" type="text/css" href="main.css">
<SCRIPT>
function validate()
{
var validateArray = new Array("associate_weight", "customer_weight", "problem_weight", "business_weight", "technical_weight", "adaptability_weight", "cognitive_weight", "organizational_weight", "self_weight", "teamwork_weight", "staff_weight", "financial_weight", "client_weight", "operations_weight", "personal_weight", "department_weight", "associate_grade", "customer_grade", "problem_grade", "business_grade", "technical_grade", "adaptability_grade", "cognitive_grade", "organizational_grade", "self_grade", "teamwork_grade", "staff_grade", "financial_grade", "client_grade", "operations_grade", "personal_grade", "department_grade");
fail=0;
for (var i=0; i<35; i++)
{
oField = document.forms[0].elements[validateArray[i]]
if ((oField))
{
if (oField.value=='')
{
var fail=1;
}
}
}
if (fail==1)
{
alert('Please complete all fields.');
event.returnValue=false;
}
}
function omg1()
{
parent.top.framer.omg();
}
</SCRIPT>
</head>
<body>
<center><img src="./images/step_three.jpg"></center>
<form name="mainform" action="build_step4.php" method="post" onsubmit="validate();">
<center><table></center>
<td colspan=5 align=center><p>Enter Performance Information</p></td></tr>
<tr><td width=25% rowspan=18>
<iframe src="build_step3_inline_contents.php" title="disptasks" height=500></iframe>
</td>
<td><b>Category</b></td><td><b>Weight</b></td><td><b>Grade</b></td><td><b>Comments</b></td></tr>
<tr><td>ASSOCIATE DEVELOPMENT</td><td><select onchange="omg1();" name="associate_weight" size=1><option value=""></option><option value="high">High</option><option value="medium">Medium</option><option value="low">Low</option></select></td><td><select name="associate_grade" size=1><option value=""></option><option value="5">Exceptional Performance</option><option value="4">Exceeds Expectations</option><option value="3">Meets Expectations</options><option value="2">Below Expecatations</option><option value="1">Unsatisfactory Performance</option></select></td><td><input type="text" name="associate_comments" size=50 value=""></td></tr>
<tr><td>CUSTOMER RELATIONS</td><td><select name="customer_weight" size=1><option value=""></option><option value="high">High</option><option value="medium">Medium</option><option value="low">Low</option></select></td><td><select name="customer_grade" size=1><option value=""></option><option value="5">Exceptional Performance</option><option value="4">Exceeds Expectations</option><option value="3">Meets Expectations</options><option value="2">Below Expecatations</option><option value="1">Unsatisfactory Performance</option></select></td><td><input type="text" name="customer_comments" size=50 value=""></td></tr>
<tr><td>PROBLEM DEVELOPMENT</td><td><select name="problem_weight" size=1><option value=""></option><option value="high">High</option><option value="medium">Medium</option><option value="low">Low</option></select></td><td><select name="problem_grade" size=1><option value=""></option><option value="5">Exceptional Performance</option><option value="4">Exceeds Expectations</option><option value="3">Meets Expectations</options><option value="2">Below Expecatations</option><option value="1">Unsatisfactory Performance</option></select></td><td><input type="text" name="problem_comments" size=50 value=""></td></tr>
<tr><td>BUSINESS ADMINISTRATION</td><td><select name="business_weight" size=1><option value=""></option><option value="high">High</option><option value="medium">Medium</option><option value="low">Low</option></select></td><td><select name="business_grade" size=1><option value=""></option><option value="5">Exceptional Performance</option><option value="4">Exceeds Expectations</option><option value="3">Meets Expectations</options><option value="2">Below Expecatations</option><option value="1">Unsatisfactory Performance</option></select></td><td><input type="text" name="business_comments" size=50 value=""></td></tr>
<tr><td>TECHNICAL</td><td><select name="technical_weight" size=1><option value=""></option><option value="high">High</option><option value="medium">Medium</option><option value="low">Low</option></select></td><td><select name="technical_grade" size=1><option value=""></option><option value="5">Exceptional Performance</option><option value="4">Exceeds Expectations</option><option value="3">Meets Expectations</options><option value="2">Below Expecatations</option><option value="1">Unsatisfactory Performance</option></select></td><td><input type="text" name="technical_comments" size=50 value=""></td></tr>
<tr><td>ADAPTABILITY</td><td><select name="adaptability_weight" size=1><option value=""></option><option value="high">High</option><option value="medium">Medium</option><option value="low">Low</option></select></td><td><select name="adaptability_grade" size=1><option value=""></option><option value="5">Exceptional Performance</option><option value="4">Exceeds Expectations</option><option value="3">Meets Expectations</options><option value="2">Below Expecatations</option><option value="1">Unsatisfactory Performance</option></select></td><td><input type="text" name="adaptability_comments" size=50 value=""></td></tr>
<tr><td>COGNITIVE</td><td><select name="cognitive_weight" size=1><option value=""></option><option value="high">High</option><option value="medium">Medium</option><option value="low">Low</option></select></td><td><select name="cognitive_grade" size=1><option value=""></option><option value="5">Exceptional Performance</option><option value="4">Exceeds Expectations</option><option value="3">Meets Expectations</options><option value="2">Below Expecatations</option><option value="1">Unsatisfactory Performance</option></select></td><td><input type="text" name="cognitive_comments" size=50 value=""></td></tr>
<tr><td>ORGANIZATIONAL CITIZENSHIP</td><td><select name="organizational_weight" size=1><option value=""></option><option value="high">High</option><option value="medium">Medium</option><option value="low">Low</option></select></td><td><select name="organizational_grade" size=1><option value=""></option><option value="5">Exceptional Performance</option><option value="4">Exceeds Expectations</option><option value="3">Meets Expectations</options><option value="2">Below Expecatations</option><option value="1">Unsatisfactory Performance</option></select></td><td><input type="text" name="organizational_comments" size=50 value=""></td></tr>
<tr><td>SELF MANAGEMENT & PERSONAL LEADERSHIP</td><td><select name="self_weight" size=1><option value=""></option><option value="high">High</option><option value="medium">Medium</option><option value="low">Low</option></select></td><td><select name="self_grade" size=1><option value=""></option><option value="5">Exceptional Performance</option><option value="4">Exceeds Expectations</option><option value="3">Meets Expectations</options><option value="2">Below Expecatations</option><option value="1">Unsatisfactory Performance</option></select></td><td><input type="text" name="self_comments" size=50 value=""></td></tr>
<tr><td>TEAMWORK & INTERPERSONAL SKILLS</td><td><select name="teamwork_weight" size=1><option value=""></option><option value="high">High</option><option value="medium">Medium</option><option value="low">Low</option></select></td><td><select name="teamwork_grade" size=1><option value=""></option><option value="5">Exceptional Performance</option><option value="4">Exceeds Expectations</option><option value="3">Meets Expectations</options><option value="2">Below Expecatations</option><option value="1">Unsatisfactory Performance</option></select></td><td><input type="text" name="teamwork_comments" size=50 value=""></td></tr>
<tr><td>FINANCIAL</td><td><select name="financial_weight" size=1><option value=""></option><option value="high">High</option><option value="medium">Medium</option><option value="low">Low</option></select></td><td><select name="financial_grade" size=1><option value=""></option><option value="5">Exceptional Performance</option><option value="4">Exceeds Expectations</option><option value="3">Meets Expectations</options><option value="2">Below Expecatations</option><option value="1">Unsatisfactory Performance</option></select></td><td><input type="text" name="financial_comments" size=50 value=""></td></tr>
<tr><td>CLIENT SUPPORT</td><td><select name="client_weight" size=1><option value=""></option><option value="high">High</option><option value="medium">Medium</option><option value="low">Low</option></select></td><td><select name="client_grade" size=1><option value=""></option><option value="5">Exceptional Performance</option><option value="4">Exceeds Expectations</option><option value="3">Meets Expectations</options><option value="2">Below Expecatations</option><option value="1">Unsatisfactory Performance</option></select></td><td><input type="text" name="client_comments" size=50 value=""></td></tr>
<tr><td>OPERATIONS</td><td><select name="operations_weight" size=1><option value=""></option><option value="high">High</option><option value="medium">Medium</option><option value="low">Low</option></select></td><td><select name="operations_grade" size=1><option value=""></option><option value="5">Exceptional Performance</option><option value="4">Exceeds Expectations</option><option value="3">Meets Expectations</options><option value="2">Below Expecatations</option><option value="1">Unsatisfactory Performance</option></select></td><td><input type="text" name="operations_comments" size=50 value=""></td></tr>
<tr><td>PERSONAL DEVELOPMENT</td><td><select name="personal_weight" size=1><option value=""></option><option value="high">High</option><option value="medium">Medium</option><option value="low">Low</option></select></td><td><select name="personal_grade" size=1><option value=""></option><option value="5">Exceptional Performance</option><option value="4">Exceeds Expectations</option><option value="3">Meets Expectations</options><option value="2">Below Expecatations</option><option value="1">Unsatisfactory Performance</option></select></td><td><input type="text" name="personal_comments" size=50 value=""></td></tr>
<tr><td>OVERALL</td><td align=center>N/A</td><td><select name="overall_grade" size=1><option value="0">Auto</option><option value="5">Exceptional Performance</option><option value="4">Meets Expectations</options><option value="3">Meets Expectations</options><option value="2">Below Expecatations</option><option value="1">Unsatisfactory Performance</option></select></td><td><input type="text" name="overall_comments" size=50 value=""></td></tr>
<tr><td> </td></tr>
<tr><td align=center colspan=5><input type="Submit" value="Finalize"></td></tr>
</table>
</form>
<div id="nav">
<center><p><A HREF="build_step2.php"><img src="./images/back_arrow.gif" alt="Back" border=0></A> <A HREF="index.php"><img src="./images/up_arrow.gif" alt="Home" border=0></A></p></center>
</div>
<center><div>
<iframe width=700 height=100 name="framer" id="framer" frameborder=0>
<script>
function round_decimals(original_number, decimals)
{
var result1 = original_number * Math.pow(10, decimals)
var result2 = Math.round(result1)
var result3 = result2 / Math.pow(10, decimals)
return pad_with_zeros(result3, decimals)
}
function pad_with_zeros(rounded_value, decimal_places)
{
var value_string = rounded_value.toString()
var decimal_location = value_string.indexOf(".")
if (decimal_location == -1)
{
decimal_part_length = 0
value_string += decimal_places > 0? "." : ""
}
else
{
decimal_part_length = value_string.length - decimal_location - 1
}
var pad_total = decimal_places - decimal_part_length
if (pad_total > 0)
{
for (var counter = 1; counter <= pad_total; counter++)
value_string += "0"
}
return value_string
}
function omg()
{
var totalWeights = new Array("associate_weight", "customer_weight", "problem_weight", "business_weight", "technical_weight", "adaptability_weight", "cognitive_weight", "organizational_weight", "self_weight", "teamwork_weight", "staff_weight", "financial_weight", "client_weight", "operations_weight", "personal_weight", "department_weight");
var max = totalWeights.length;
var highWeights = new Array();
var mediumWeights = new Array();
var lowWeights = new Array();
for (var i=0; i<35; i++)
{
oField = parent.document.forms[0].elements[totalWeights[i]]
if ((oField))
{
if (oField.value=='high')
{
highWeights[highWeights.length] = oField;
}
if (oField.value=='medium')
{
mediumWeights[mediumWeights.length] = oField;
}
if (oField.value=='low')
{
lowWeights[lowWeights.length] = oField;
}
}
}
var highs = highWeights.length;
var mediums = mediumWeights.length;
var lows = lowWeights.length;
var total = highs + mediums + lows;
var highPercent = highs / total;
highPercent = highPercent * 100;
highPercent = round_decimals(highPercent, 0);
var mediumPercent = mediums / total;
mediumPercent = mediumPercent * 100;
mediumPercent = round_decimals(mediumPercent, 0);
var lowPercent = lows / total;
lowPercent = lowPercent * 100;
lowPercent = round_decimals(lowPercent, 0);
var highest = highPercent;
if (mediumPercent > highPercent) { highest = mediumPercent; }
if (mediumPercent > lowPercent) { highest = mediumPercent; }
if (lowPercent > mediumPercent) { highest = lowPercent; }
if (lowPercent > highPercent) { highest = lowPercent; }
document.write('<table>');
document.write('<tr><td>High = </td><td bgcolor=CCCCCC colspan=');
document.write(highPercent);
document.write('>');
document.write(highPercent);
document.write('</td></tr>');
document.write('<tr><td>Medium = </td><td bgcolor=CCCCCC colspan=');
document.write(mediumPercent);
document.write('>');
document.write(mediumPercent);
document.write('</td></tr>');
document.write('<tr><td>Low = </td><td bgcolor=CCCCCC colspan=');
document.write(lowPercent);
document.write('>');
document.write(lowPercent);
document.write('</td></tr>');
document.write('<tr>');
for (var n=1; n<highest; n++)
{
document.write('<td> </td>');
}
document.write('</tr></table>');
}
</script>
</iframe>
</div></center>
</body>
</html>
I'm stuck! Have been all day! Could someone please help me, please?