Apna Code

Code, Tutorials and Snippets by Adeel Sarfraz

  • Home
  • About Us
  • Contribute
  • Contact Us
  • Privacy Policy
  • Terms and Conditions

JavaScript

Google Bar Chart Sample Script

December 18, 2018 Adeel Sarfraz 0

Google provides a very good chart package which allows you to integrate with your website via JavaScript. You just need to feed the values and […]

Robots.txt Generator Script

November 20, 2018 Adeel Sarfraz 0

If you would like to generate a robots.txt file for your website and you are not sure what to put in it then have no […]

How to disallow Enter key on a form using JavaScript

December 20, 2016 Adeel Sarfraz 0

You may have come across situations where you don’t want the HTML form to submit on pressing Enter key. The reason could be that you […]

No Image

How to force page to fully load all JavaScript libraries before user interaction using jQuery

July 5, 2015 Adeel Sarfraz 0

If your web page contains a lot of JavaScript libraries (local and external) then you may have come across a situation where the page may […]

No Image

How to update the value of SELECT options using jQuery

July 1, 2015 Adeel Sarfraz 0

Sometimes you may across a situation where you need to update the value of your drop down options based on some condition in your form. […]

No Image

How to allow only numbers in a text box using jQuery

July 1, 2015 Adeel Sarfraz 0

If you have a form on a web page and you only want to allow numbers 0-9 to be input in the textbox and disallow […]

No Image

How to update links on web page to open in new window using JavaScript

June 30, 2015 Adeel Sarfraz 0

If you would like to open some links on your web page on a new page and you would like it to be done automatically […]

No Image

How to uncheck checkbox in custom form elements using JavaScript

May 17, 2014 Adeel Sarfraz 1

Ryan Fait has added a wonderful script which can help you customize the look and feel of the form elements on your web page like […]

No Image

How to allow only one space in full name field using JavaScript

January 30, 2014 Adeel Sarfraz 0

Some times we need to force customer to enter the details as required by our system. We can validate the input using regular expression in […]

No Image

How to trim a string of whitespace using a function in JavaScript

December 2, 2013 Adeel Sarfraz 0

Following is a custom JavaScript function which will trim whitespace characters from your string variable. This function can also be used in your validation functions […]

Recent Posts

  • How to stop users from copy pasting content from my web page
  • How to fetch posts from my WordPress blog without accessing the database
  • How to use Google font on my web page?
  • How to check if my website is safe from malware infection
  • How to perform session timeout after 20 minutes using PHP?

Code Gallery

Apna Code Scripts - where you can view all scripts coded which you can use on your website.

Copyright © 2021 | WordPress Theme by MH Themes