Disable HTML Input Field And Make It Un-clickable
Here in this post, I am going to tell you how to disable a form field in an HTML form easily.
It is very easy and simple task to disable any input field of an HTML form. There is an HTML input disable attribute available which will do this task for you.
below is the example code of an HTML form with a disabled input field:
<form action="process.php"> Test form field with disabled attribute: <input type="text" name="disable_field" disabled><br> Test form field without disabled attribute: <input type="text" name="lname" ><br> <input type="submit" value="Submit"> </form>
If you test the above HTML code on and open it with your browser, it will show you the result that is shown below:
You can see that the first one field can not be fill up by a user as it is using the disable HTML form attribute to disabled it from the user. But the second one field can be fill up by the user as it is not using the disabled attribute.
An input element that is using disabled attribute is unusable and un-clickable. If you test it, you will see that nothing happening when you click on it.
So you can see that the process is so simple and easy. You can easily make any field of your HTML form un-clickable. I hope you have got your answer if you are searching for something that disables users from filling input field.