I provided a solution for a VBS thread regarding fraction simplification - thread329-1697266. The solution accepts two values and simplies them as if they were the nominator and the denominator; works beautifully when run as a VBS. However, when implemented into an HTML, the values are read properly but processed in a truncated form. What gives!?
Example
A: 5 B: 25, read as 5 and 25 but processed as 5 and 2
A: 11 B: 4, read as 11 and 4 but processed as 1 and 4
A: 4867 B: 7, read as 4867 and 7 but processed as 4 and 7
You can see how this can present a HUGE problem. Here is a simplified cut/paste ready instance that demostrates the "error"
-Geates
Example
A: 5 B: 25, read as 5 and 25 but processed as 5 and 2
A: 11 B: 4, read as 11 and 4 but processed as 1 and 4
A: 4867 B: 7, read as 4867 and 7 but processed as 4 and 7
You can see how this can present a HUGE problem. Here is a simplified cut/paste ready instance that demostrates the "error"
Code:
<html>
<script language="vbscript">
sub process()
a = txt1.value
b = txt2.value
if (a > b) then
msgbox "Apple"
else
msgbox "Banana"
end if
end sub
</script>
A: <input id="txt1" type="text" value=""/><br>
B: <input id="txt2" type="text" value=""/><br>
<input type="button" value="Simplify Fraction" onClick="process()"/>
</html>
-Geates