Author |
Message |
Cheese Wow Cheese is so helpful!
Joined: Mar 18 2007 Posts: 1017 Offline
|
Posted: Wed Oct 31, 2007 5:16 pm Post maybe stupid Post subject: broken form |
|
|
|
|
yep, i know i suck with forms...
but im trying to learn
im working on a twd calculator
and i ~almost~ have it working
but its broken and i have no idea why
cz.sshq.net/form.html
any suggestions? _________________ SSC Distension Owner
SSCU Trench Wars Developer |
|
Back to top |
|
|
Doc Flabby Server Help Squatter
Joined: Feb 26 2006 Posts: 636 Offline
|
|
Back to top |
|
|
Cheese Wow Cheese is so helpful!
Joined: Mar 18 2007 Posts: 1017 Offline
|
Posted: Thu Nov 01, 2007 7:08 pm Post maybe stupid Post subject: |
|
|
|
|
tried using 0, same thing
is it treating yours as a string or something?
O_o" |
|
Back to top |
|
|
Cheese Wow Cheese is so helpful!
Joined: Mar 18 2007 Posts: 1017 Offline
|
|
Back to top |
|
|
Cheese Wow Cheese is so helpful!
Joined: Mar 18 2007 Posts: 1017 Offline
|
Posted: Thu Nov 01, 2007 7:15 pm Post maybe stupid Post subject: |
|
|
|
|
like its doing 150+(20*5) as 150100 or something
<input class="form" type="text" id="yours"
would that kill it? |
|
Back to top |
|
|
Mine GO BOOM Hunch Hunch What What
Age:40 Gender: Joined: Aug 01 2002 Posts: 3614 Location: Las Vegas Offline
|
Posted: Thu Nov 01, 2007 8:42 pm Post maybe stupid Post subject: |
|
|
|
|
Cheese wrote: | like its doing 150+(20*5) as 150100 |
Wild guess here, but I'm assuming you are using javascript. Doing + like that in a loosely typed language will result in the language guessing what data type it is. Since the user input is a string (there is not input type=integer), it is going with a string for '150'. Thus it concatenates the string and the value of (20*5) which it takes as integers, making the '150' + '100' be '150100'.
Look up how to force a variable to be casted as a specific data type, and force the user input into be numeric, be it integers (whole numbers) or floating points (has decimals). |
|
Back to top |
|
|
CypherJF I gargle nitroglycerin
Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Thu Nov 01, 2007 8:50 pm Post maybe stupid Post subject: |
|
|
|
|
Good learning resource -
http://www.w3schools.com/ _________________ Performance is often the art of cheating carefully. - James Gosling |
|
Back to top |
|
|
Cheese Wow Cheese is so helpful!
Joined: Mar 18 2007 Posts: 1017 Offline
|
Posted: Thu Nov 01, 2007 9:16 pm Post maybe stupid Post subject: |
|
|
|
|
i have it bookmarked already ;D |
|
Back to top |
|
|
Cheese Wow Cheese is so helpful!
Joined: Mar 18 2007 Posts: 1017 Offline
|
Posted: Fri Nov 02, 2007 12:56 am Post maybe stupid Post subject: |
|
|
|
|
pretty sure its either the (- or the ^(
problems suck =( |
|
Back to top |
|
|
Cheese Wow Cheese is so helpful!
Joined: Mar 18 2007 Posts: 1017 Offline
|
|
Back to top |
|
|
|