Posts

Showing posts from December, 2023

Disable Cut,Copy and Paste using jQuery

Image
 How to prevent cut, copy, paste in text box.       Generally while registering in website, user forced to type manually some data. Ex: confirm email/confirm password. It is because to ensure user entered correct data. This tutorial shows how to stop cut, copy, pasting data in a text field while entering his details such as email/password. The below example shows how to prevent cut, copy, and pasting in confirm email input field. This is implemented using jQuery. With the help of jQuery bind() function, it can be achieved. In the bind() function, you have to specify the cut, copy, and paste events that are fired when a user attempts to cut, copy, or paste in a text field. When it occurs, it shows an alert message to the user.   TOP   index.php <html> <head> < title >Codingzon Tutorials< /title> <head> < script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js" >< /script> < script > $( document ).

Count Characters in Textarea with jQuery

Image
 Counting characters in textarea with jQuery     In web applications, when designing forms for receiving data from users, such as product feedback, etc., it is necessary to allow users to input a limited amount of text. It can help to prevent spam and avoid reading unnecessary long messages. It also saves resources. So In this blog, you are going to learn  shows how to limit number of characters and display characters left in textarea while user entering text in the textarea component. It also includes, how to count characters in a text that is entered in a text box using jQuery .   Here is an example.  MOVETOP↑   countcharacters.php <html> <head> <title> Codingzon Tutorials http://localhost/phpuseful/countchars.php# </title> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js" ></script> <body bgcolor= "" > <center> <br /><br /><br /><br /> <

How to show current date in Html date field

Image
 Date field default date in HTML      In this tutorial, we learn How to set up current date as a default date value in HTML date field using JavaScript. It is visible when a page is loaded. Here is an example: In this code, we used the JavaScript date to generate a date and set that date to the HTML date field. MOVETOP↑   index.php   <html> <head> <title> Codingzon Tutorials </title> <body bgcolor= "" > <center> <p id= "datetime" > </p> <form> Current Date: <input type= "date" name= "date1" id= "date1" plaseholder= "Date1" ><br/> </form> <script>   // ***************** Get current date and time in JavaScript ***************** // var now = new Date (); // reading each part of datetime var day = now.getDate(); var month = now.getMonth() + 1 ; var year = now.getFullYear(); if (month < 10 ) month = "0"