Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Javascript PHP Form Validation Classes/Scripts

  • 02-03-2011 11:25AM
    #1
    Registered Users, Registered Users 2 Posts: 912 ✭✭✭


    I've been meaning to tidy up my website form validation in general.

    I have been using simple JavaScript validation on the client side and ad-hoc PHP written on the Server. And combinations of the two.

    I'm long overdue to sort this out properly with both Javascript and PHP validation (maybe some Ajax) to do it.

    There are lot of tutorials etc on the web but I was wondering if anyone has any recommendations of tutorials or of re-usable classes or scripts.

    Feel free to move to development if more relevant.

    Many thanks for any thoughts.


Comments

  • Registered Users, Registered Users 2 Posts: 8,070 ✭✭✭Placebo


    i personally use this all the time: http://bassistance.de/jquery-plugins/jquery-plugin-validation/

    Its a jquery plugin. Handles all sorts of validation, you can even make custom methods. Ajax would be handy if you needed to check if a username[or email?] was already in use. Other than that i just use severside[php] to check if they are already in use and display the message accordingly.
    Ofcourse then you might have to use session variables so people dont lose all their inputs etc

    i dont think its necessary to have the same checks again on server side, Strictly speaking you should have them incase the user does not have javascript enabled/installed.


  • Registered Users, Registered Users 2 Posts: 912 ✭✭✭chakotha


    I'll check that out Placebo thanks.

    I must put together some more thorough server side form data sanitation and sql injection prevention code too.


Advertisement