How to Disable Right Click in embed Tag using JavaScript


You can easily disable mouse right click in the web page, but it will not work in the and IFrame. The main purpose of disabling right click is to prevent the user from saving the PDF or document content. If you want to disable right click in embed tag, JavaScript onmousedown event help to do that easily.


How to Get IP Address of User in PHP


PHP $_SERVER variable provides an easy way to get user IP address. The simplest way to get the visitor IP address is using the REMOTE_ADDR in PHP. Use $_SERVER[‘REMOTE_ADDR’] to get IP address of the user in PHP. Alternatively, use HTTP_X_FORWARDED_FOR to get real IP address of user in PHP.


How to Pass PHP Array to JavaScript Function


The json_encode() function in PHP provides an easy way to pass an array to JavaScript. Using json_encode() function, you can pass multidimensional array to the JavaScript function and the PHP array can be accessed as a JavaScript object.


How to Redirect Old URL to New URL using .htaccess File


Sometimes needs to change the URL structure for SEO or other purposes. In that case, the old URL shows 404 error which is very confusing for the website’s visitor. To avoid this situation, you can redirect the old page (non-existing) request to new page URL by the .htaccess file.


How to Allow Only One Checkbox to be Checked using jQuery


Generally, we used radio buttons to let a user select ONE option from a limited number of choices. Most of the cases radio buttons are ideal to select a single option from a group of the options. If you want to allow the user to check only one checkbox from a group of the checkboxes, it can be done easily using jQuery.


How to Change Marker Position on Google Map using JavaScript


Google Maps JavaScript API provides various option to customize the Google Map functionality as per your needs. The marker position change on Google Map is one of them. Using JavaScript you can easily change the position of the marker on Google map without page refresh. Use setPosition() to change the position of the marker on Google Map.


Phone Number Validation with HTML5


It is important to take security seriously when you collecting data from the users. Form data validation is required before submitting to the database. You can implement the client-side form validation easily with HTML5 without using jQuery. Use type and pattern attribute in HTML input field to validate a phone number.


How to Check if One Radio Button in Each Group is Checked using jQuery


Before submitting the value of the radio button group, it is required to check whether the user selects one radio button in each group. Because it’s always a good idea to validate the value in the client before sending data to the server side. Here we will show you how to check if one radio button in each group is checked using jQuery.


How to Convert Text Field Value to Uppercase While Typing


Using jQuery you can automatically convert text field value while typing. Not only the jQuery, here we will show you the three different way to transform text field data to uppercase while typing. You can convert text to uppercase using jQuery or JavaScript or CSS.