Category: snippets

How to create a Button with Rounded Corners using CSS

In CSS3 you can give elements rounded corners with the border-radius property. Let’s look at an example of this.

How to Create a “Yes/No” Radio Button

Using radio button to accept Yes/No questions is best because the field accepts only one of the options. It is better than a dropdown because there are only two choices - either of them can be selected by a single click

Google reCaptcha 2 JavaScript Validation (client side)

reCaptcha is a great "bot" detection solution from Google. Google watches the pattern of user interaction to decide whether it is a "bot" or a real user. It is near impossible for a "bot" to simulate those patterns. So reCaptcha succeeds in blocking spam most of the time.

How to Add a Label to HTML Radio Button

Radio button allows user to choose only one of the pre-defined options. Each radio button must be accompanied by a label describing the choice it represents.

HTML submit button onclick code

An HTML button is created using the following HTML code:

Examples of javascript form validation using regular expressions

In this tutorial you will see how to use regular expressions to validate. Through a list of examples , we will build a script to validate phone numbers , UK postal codes, along with more examples.

First, let’s start by building the webpage and the validation code then we will talk about the regular expressions used to validate the strings. First go to your html file and paste the following code :