Jump to content


javascript checking forms.....


4 replies to this topic

#1 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 17 March 2006 - 09:31 PM

###EDIT####

3rd edit... nobody even bother to look at this thread hah....

how can i make sure that spaces are stripped from an input field using javascript?

what i also need is how do i take that if/else statement and if everything is fine (else{ return 1; }), take some php action, how can i do that?

Edited by coolaid, 18 March 2006 - 12:54 AM.


#2 Stu

    Retired P2L Staff

  • Publishing Betazoids
  • PipPipPipPip
  • 1,761 posts
  • Gender:Male

Posted 18 March 2006 - 08:19 AM

can i just ask why you need to use js for this? im sure you know the pros and cons of using js/php for error checking so i wont patronise you by going into that...

stripping spaces with js ive only found one solution and that will only work in IE, maybe you can try modify it to work with ff and other browsers though...

http://javascript.internet.com/forms/remov...whitespace.html

#3 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 18 March 2006 - 04:16 PM

i just want a quick way of checking forms rather than go through the server

#4 Stu

    Retired P2L Staff

  • Publishing Betazoids
  • PipPipPipPip
  • 1,761 posts
  • Gender:Male

Posted 18 March 2006 - 05:59 PM

the difference in speed will be hardly noticable though. if js is the way you want to go then thats fair enough, but i cant help but think this is three or four lines of code in php and so much easier :)

#5 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 18 March 2006 - 08:37 PM

***** problem solved *****

but anyway, the main reason i want to do this is just so instead of proccessing the page, just use an alert to notify if some forms are missing, i just like it more, even though i do realize it would be just as easy with php.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users