JavaScript Examples

Check File Extension using JS

In this tutorial we will see how to check the extension of the uploaded file in a form using Javascript. In the example below user is allowed to upload only zip,rar and tar.gz file extensions.

You can edit the simple script to allow other extensions.

Check out the script given below - 

Read More

javascript

Form Validation radio

A simple javascript technique that uses the name attribute of the html document to get Element value(s) is used for validating the form ...

(You can check similar examples of form validation in the Javascript section)

 

 

Read More

javascript

Multiple submit button in a single form

Let us create a simple form where a user is allowed to create a content in text field. Then one can either preview or save the content. On click of each button, a javascript function is called and we determine which button was Clicked. We can now call either a same php or different phps as a form action with different buttons.

Read More

javascript