Add/Remove Input Fields Dynamically with jQuery

If you are looking to add and remove duplicate input fields, here’s another jQuery example below to do the task for you. This jQuery snippet adds duplicate input fields dynamically and stops when it reaches maximum.

Restrict multiple URLs in Input with jQuery

If you want to restrict users from entering more than one or two URL, just use the following jQuery snippet. All we need to do is use RegEx expression and using JavaScript match(), we can search for URL or some other words in textarea.

Check Facebook User Permissions (PHP)

I assume you are using Facebook PHP SDK in your project, if you need to check multiple permissions granted by the user using PHP, try following method. We will break string into an array, and then check for the permissions already granted by the user.

Confirmation dialog on leaving page (Javascript)

If you want to show confirmation dialog before user leaves or reloads the page, you can use Javascript onbeforeunload() event attribute. When unload event fires, it shows a prompt asking whether user wants to leave or reload the page. Most browsers will return the event string, but in some browsers such as Firefox it may not be displayed.