jalarie

msg:1480117 | 4:37 pm on Nov 2, 2005 (gmt 0) |
I believe the problem is at the line "ktot=kpp+kph;" which is concatinating rather than adding the values. Changing it to "ktot=kpp*1+kph*1;" might help.
|
Fotiman

msg:1480118 | 5:09 pm on Nov 2, 2005 (gmt 0) |
You could also try using parseFloat.
kpp = parseFloat(kpp); kph = parseFloat(kph); if(!isNaN(kpp) &&!isNaN(kph) ) { ktot = kpp + kph; }
|
Bernard Marx

msg:1480119 | 5:16 pm on Nov 2, 2005 (gmt 0) |
[b][red]I[/red][/b]f(ktot>8) These might be useful too (place outside function): /* change corrupted ¦ char to a pipe */ String.prototype.trim = function(){ return this.replace(/^\s+¦\s+$/g,'')} String.prototype.isNumeric = function(){ return this.test(/^[0-9\.]+$/);}
|
LinuxGold

msg:1480120 | 6:10 pm on Nov 2, 2005 (gmt 0) |
Ok, here is the latest source so far, I was able to bring up "passed here, with value of 12." (6 kph and 6 kpp) but didn't bring up the next alert "Exceeding 8 hours total to use PTO" it should happen.
kpp = parseFloat(kpp); kph = parseFloat(kph); if(!isNaN(kpp) &&!isNaN(kph) ) { ktot = kpp + kph; } alert("passed here, with value of " + ktot + ".") If(ktot>'8') { alert("Exceeding 8 hours total to use PTO") krono_process.khrs.focus() return false; }
|
Fotiman

msg:1480121 | 6:21 pm on Nov 2, 2005 (gmt 0) |
You have an uppercase 'I' in 'If'. Also, ktot contains a number now, but you're comparing it to the string '8'. Try this: if(ktot > 8)
That should do it.
|
LinuxGold

msg:1480122 | 6:42 pm on Nov 2, 2005 (gmt 0) |
yes! that was the problem all along -- my apologies :(
|
|