Website form validation

Hello everyone, this is my first post. I’ve a little question about validation of forms on websites to prevent spam and “unfilled” forms.

For some time, people have said that client-side validation of forms is kinda bad because people just can disable javascript etc.

But if you use javascript validation, and remove the input submit button, replace it with an:

<a href="#" onclick="javascript:document.myform.submit();">Send Message</a>

Because, if people have javascript disabled, they won’t be able to sent the form either? I know they then can go edit the html with firebug etc, and change the alink to a input type=“submit” instead - but they need to do that each time they wanna “spam” the form or site.

The reason why I’m asking, is because I normally use php, but haven’t found a way to use the FILTER_VALIDATE_URL that works, because it needs to have the “http://” in front of the link before it will validate. Which I’m wondering.

And is it okay to use “tons” of javascript on a site… Because yes, it will remove lots of features for none-javascript users. - But if you go to etc. facebook.com, disable your javascript, you can’t do anything… No status update, no chat, no comment, no “like” and so.

But just wondering if there is a good way to make client-side validation, or that I should go to the javascript/ajax or php thread to ask about validation!

Thank you much,

regards Lucas

Thank you for the answer! - I will go ask in the PHP section for server-side validation then!