Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
broken form

 
Post new topic   Reply to topic Printable version
 View previous topic  to cypher, my asss log Post :: Post What would you do?  View next topic  
Author Message
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1017
Offline

PostPosted: Wed Oct 31, 2007 5:16 pm   Post maybe stupid    Post subject: broken form Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Doc Flabby
Server Help Squatter


Joined: Feb 26 2006
Posts: 636
Offline

PostPosted: Thu Nov 01, 2007 2:30 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Code: Show/Hide

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




this is the problem you should set them to 0 not ""
_________________
Rediscover online gaming. Get Subspace | STF The future...prehaps
Back to top
View users profile Send private message Add User to Ignore List
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1017
Offline

PostPosted: Thu Nov 01, 2007 7:08 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

tried using 0, same thing

is it treating yours as a string or something?
O_o"
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1017
Offline

PostPosted: Thu Nov 01, 2007 7:12 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1017
Offline

PostPosted: Thu Nov 01, 2007 7:15 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

like its doing 150+(20*5) as 150100 or something


<input class="form" type="text" id="yours"
would that kill it?
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:40
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3614
Location: Las Vegas
Offline

PostPosted: Thu Nov 01, 2007 8:42 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Thu Nov 01, 2007 8:50 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Good learning resource -

http://www.w3schools.com/
_________________
Performance is often the art of cheating carefully. - James Gosling
Back to top
View users profile Send private message Add User to Ignore List
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1017
Offline

PostPosted: Thu Nov 01, 2007 9:16 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

i have it bookmarked already ;D
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1017
Offline

PostPosted: Fri Nov 02, 2007 12:56 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

Code: Show/Hide
p=1/(1+10^(-(y-t)/400))


pretty sure its either the (- or the ^(

problems suck =(
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1017
Offline

PostPosted: Fri Nov 02, 2007 1:41 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Trash Talk All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 764 page(s) served in previous 5 minutes.

phpBB Created this page in 0.922803 seconds : 34 queries executed (82.9%): GZIP compression disabled