×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# input values are truncated

## input values are truncated

(OP)
I provided a solution for a VBS thread regarding fraction simplification - thread329-1697266: Creating a Fraction Simplifying Calculator. 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"

#### 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

### RE: input values are truncated

Hint: String value "7" is greater than string value "4867"

Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach

### RE: input values are truncated

(OP)
Hint deciphered :)

-Geates

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!