rjusa
12-01-2003, 07:06 PM
I have the following:
**************************
<script language="JavaScript"><!--
function sum(objRef) {
var result = 0;
result += opener.document.forms[0].CndnFBpc.value - 0;
result += document.childForm1.cf1f.value - 0;
if (result > 100)
alert("Your total percent allocation exceeds 100%...please check your percent distributions");
}//--></script>
<input type="text" name="PercentPB1" value="$PercentPB1$" onkeyup="sum(this.value)">
**************************
So if a number e.g., 105 is entered, the alert pops up...this is good..but how do I prevent the user from leaving the textbox until a number <=100 is entered?
Thanks,
Ron
**************************
<script language="JavaScript"><!--
function sum(objRef) {
var result = 0;
result += opener.document.forms[0].CndnFBpc.value - 0;
result += document.childForm1.cf1f.value - 0;
if (result > 100)
alert("Your total percent allocation exceeds 100%...please check your percent distributions");
}//--></script>
<input type="text" name="PercentPB1" value="$PercentPB1$" onkeyup="sum(this.value)">
**************************
So if a number e.g., 105 is entered, the alert pops up...this is good..but how do I prevent the user from leaving the textbox until a number <=100 is entered?
Thanks,
Ron