Jump to content

Client side validation (help needed)


dbz

Recommended Posts

Hello! I'm a new php/javascript programmer. I have been building a site and I just created a user login page. Now I want to make a user signup page, and well- I would like to know how to do different types of validation to keep passwords secret. Ect.

 

Any help from anyone would be greatly appreciated. I'm going to quote w3 schools:

 

"Form Validation

 

User input should be validated on the browser whenever possible (by client scripts). Browser validation is faster and reduces the server load.

 

You should consider server validation if the user input will be inserted into a database. A good way to validate a form on the server is to post the form to itself, instead of jumping to a different page. The user will then get the error messages on the same page as the form. This makes it easier to discover the error."

 

Well. I would like to be able to do some client side validations where possible, and like I said, I would really appreciate help.

 

Thank you for your time!

 

Link to comment
Share on other sites

That w3schools quote is a bit misleading, and a good example of why you shouldn't rely on them to learn anything other than some basic syntax.

 

JavaScript validation serves one main purpose - to give the user better, more immediate feedback when they supply data to a website.  It should never be considered the last line of defense as JavaScript can be turned off in the browser, rendering such validation completely worthless.  Those with malicious intent know this, and will definitely try to exploit this innate weakness in JavaScript.  Moreover, there are still non-threatening users who surf with JavaScript disabled for a variety of reasons.  Server side validation should always be done because of this.  And, since server side validation should always be done regardless of whether or not JavaScript is involved, there's no real server load benefit.

 

The best way to do it is to use both simultaneously, using the same filtering rules on both sides to ensure nothing falls through the cracks.

 

That said, is there anything specific you need help on?  Have you written any code?

Link to comment
Share on other sites

Ah great! Thanks for those scripts.

 

And yes. I have written a tiny bit of code. (Attached)

 

I am about to make the registration form now. My attempt at learning javascript and php is writing these basic websites.

 

 

For my specific help needs. I will need help with javascript very soon. (As soon as I finish the form and write the php(+sql) I will need hep designing (or writing) the UI (the javascript components that is) for the main part of the side.

 

If I can get help now for the main UI though, I would be easily persuaded to spill my plans for how it should work and what it will do.

 

[attachment deleted by admin]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.