Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


If else javascript

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Crossrocket.1
Master Cheater
Reputation: 0

Joined: 16 Nov 2007
Posts: 307

PostPosted: Wed Dec 17, 2008 8:46 pm    Post subject: If else javascript Reply with quote

heres what i have:
Code:

function checkForm(frmTemp) {
   var error = false;
      if (frmTemp.txtAn.value.length<3){
         alert("Error: Either you forgot to add a word for an animal or your word is less then 3 words long");
         error = true;
      }
      if(frmTemp.txtRoom.value.lenght<3){         
         alert("Error: Either you forgot to add a word for a room or your word is less then 3 words long");
         error = true;
      }
      if(frmTemp.txtNme.value.lenght<3){         
         alert("Error: Either you forgot to add a name or your word is less then 3 words long");
         error = true;
      }
      if(frmTemp.txtFnme.value.lenght<3){         
         alert("Error: Either you forgot to add a friend's name(1) or the name is less then 3 words long");
         error = true;
      }
      if(frmTemp.txtFnme2.value.lenght<3){         
         alert("Error: Either you forgot to add a friend's name(2) or the name is less then 3 words long");
         error = true;
      }
      if(frmTemp.txtFnme3.value.lenght<3){         
         alert("Error: Either you forgot to add a friend's name(3) or the name is less then 3 words long");
         error = true;
      }
      if(frmTemp.txtCol.value.lenght<3){         
         alert("Error: Either you forgot to add a color or your color is less then 3 words long");
         error = true;
      }
      if(frmTemp.txtFlo.value.lenght<3){         
         alert("Error: Either you forgot to add a Florida 'Place' or your place is less then 3 words long");
         error = true;
      }
      if(frmTemp.txtNycb.value.lenght<3){         
         alert("Error: Either you forgot to add a Newyork city building or your building is less then 3 words long");
         error = true;
      }
      return error;
}           

But it doent work the way i want it to.
if the person enters the first one 3 or more letters, then the story shows up. can u make it so it checks the whole god damn function?
[/code]
_________________
Back to top
View user's profile Send private message
sloppy
Expert Cheater
Reputation: 0

Joined: 17 Aug 2008
Posts: 123

PostPosted: Thu Dec 18, 2008 12:53 am    Post subject: Reply with quote

You have a few typos.. value.lenght? and if you are using firefox, open up the error console (tools->error console) so you can view javascript warning/error messages.
Back to top
View user's profile Send private message
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Thu Dec 18, 2008 1:49 am    Post subject: Reply with quote

It would be far less annoying to do something like "aString += "error: You forgot name\n"; then in the next error do the same thing, and at the end if there is any error, alert the whole thing.
_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
Crossrocket.1
Master Cheater
Reputation: 0

Joined: 16 Nov 2007
Posts: 307

PostPosted: Fri Dec 19, 2008 7:32 am    Post subject: Reply with quote

thx guys!
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot 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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites