Captcha Using JavaScript

Captcha Using JavaScript:

Now a days most of the forms in websites, whenever we register we can see Captcha is becoming mandatory to check whether it is an user or some automated software. CAPTCHA stands for – Completely Automated Public Turing Test To Tell Computers and Humans Apart. As the name suggests it helps to differentiate automated software vs human beings.

In this article, Let us see how can we create a Captcha using JavaScript, Display random text to the user and validate the Captcha. In this example, I have created only checking and validating captcha, which can be included in the forms.




Simple Javascript Validation without Alerts

Simple Javascript Validation without Alerts
In this article we are going to see simple Javascript form validations without using alerts.

We are going to validate the form fields and display the message near the text box.

We are going to have 4 fields in the html,
Username:  if this field is left empty an error message is shown near the textbox and when some value is entered in this field the message disappears

Email: This field should have ‘@’ to confirm it as email address, if not show an error message. If value is entered error message should disappear

Password: Should be greater than 6 characters if not show error message, on correct entry error message disappears

Pattern: This field will check for Regular Expression pattern. No special characters allowed in this field.