Server Help

Trash Talk - broken form

Cheese - Wed Oct 31, 2007 5:16 pm
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?
Doc Flabby - Thu Nov 01, 2007 2:30 pm
Post subject:
Code: Show/Hide

  win.value=""
  lose = form.lose
  lose.value=""




this is the problem you should set them to 0 not ""
Cheese - Thu Nov 01, 2007 7:08 pm
Post subject:
tried using 0, same thing

is it treating yours as a string or something?
O_o"
Cheese - Thu Nov 01, 2007 7:12 pm
Post subject:
Code: Show/Hide
  p=1/(1+10^(-(y-t)/400))
  w=y+(50*(1-p))
  l=y+(50*(0-p))


im pretty sure the problems somewhere in there
Cheese - Thu Nov 01, 2007 7:15 pm
Post subject:
like its doing 150+(20*5) as 150100 or something


<input class="form" type="text" id="yours"
would that kill it?
Mine GO BOOM - Thu Nov 01, 2007 8:42 pm
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).
CypherJF - Thu Nov 01, 2007 8:50 pm
Post subject:
Good learning resource -

http://www.w3schools.com/
Cheese - Thu Nov 01, 2007 9:16 pm
Post subject:
i have it bookmarked already ;D
Cheese - Fri Nov 02, 2007 12:56 am
Post subject:
Code: Show/Hide
p=1/(1+10^(-(y-t)/400))


pretty sure its either the (- or the ^(

problems suck =(
Cheese - Fri Nov 02, 2007 1:41 am
Post subject:
i expanded it into
Code: Show/Hide

a=y-t
b= (-a)/400
c=1+pow(10,b)
p=1/c
w=y+(50*(1-p))
l=y+(50*(0-p))


but then it says object expected on the pow() line
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group