Posts in Category: snippets

Adjust li width fit with ul width of the outer div/body

HTML:-

CSS:-

JavaScript:-

 

Read More

JavaScript simple form validation with example

Any interactive web site has form input – a place where the users input different kind of information. This data is passed to PHP Script, or some other technology and if the data contains an error, there will be a delay before the information travels over the Internet to the

Read More

Simple Ajax Call

 

Read More

Bootstrap Button Loading

 

Read More

jQuery : Disable and Enable Selected Options in DropDownList

To disable the selected option from select input element, following piece of code can be used,


and to enable an option that is disabled already,

In this example, let us have one div for each option of select element with the option text and a remove link which

Read More

Customize Input Box using jQuery

Prevent users typing special characters in text box, textarea, etc.

^[a-zA-Z]+$ Alphabets
^[a-zA-Z\s]+$ Alphabets + Space

Example:-

Read More

Clear the browser cache of CSS or JavaScript Using Javascript

 

Read More

How can I disable an option in a select box based on its value in JavaScript?

Without enabling non-targeted elements:

jQuery

With jQuery you can do this with a single line:


Without enabling non-targeted elements:

Note that this is not case insensitive. “optionvalue” will not equal “optionvalue”. To get a case-insensitive match, you’d have to cycle through each, converting the value to a lower case, and

Read More

Javascript Slugify

 

Read More