Disable form fields
You have the power to disable anything in HTML. What a rush. Let's see it in action.
Video Transcript
00:00Alright before we move into a new topic. I wanted to talk briefly about how do you disable element now you might ask
00:08Why so the reason is is if you're a programmer and you're programming you might have scenarios where you don't want to let the user
00:14To input their information yet, but let them know that they could so for example
00:18You might want to create some sort of form where the user has to answer in a sequential order
00:23And only once they answer in that sequential order then you enable it and let the user submit information
00:28Or for example you have like maybe a survey and if the user answers a certain answer in question number one
00:34Then you want to disable question number three because it's not relevant and so on and so forth
00:39Okay, now you can't really do it without knowing JavaScript, but you could know how to disable things
00:44I don't want to show you how to disable things. It's very simple
00:47the first step is I'm just gonna go for example to my reset button put a space there and just write the word this a
00:53this a
00:55bold
00:56Right past tense disabled and that will make our button disabled if I go back into our element click on refresh here
01:03We'll see that now our button will be disabled and you won't be able to click on it
01:06For example, maybe we don't want to have the login for example work
01:10Or you won't be able to submit it until you fill up all the information and that you would do with the JavaScript
01:15Okay, okay now
01:16I want to show you now this works this property works throughout the different properties or anything
01:21That's a user input could be defined in that way
01:24So for example if we wanted to disable a certain option such as you suck because we just don't want to let people say that we suck
01:30Then we could just add your disable and really frustrate whoever thinks we suck, which I love that
01:35Okay, so we're gonna disable anyone that thinks that we suck and frustrate them. I
01:41Love that. All right. So if we go back into our page and click on refresh
01:46We'll see that a specific component that specific option is now disabled. You see it's not clickable anymore
01:53Beyond that we could also disable the whole component if we wanted to so if we wanted to we could have gone all the way up
01:58to the actual selection group and just set it to be this a
02:02Bold and literally anything that is a user input element
02:06You could just add disabled into it and make it disabled and not clickable anymore
02:10So if I click on refresh here, we'll see now this element is disabled and there's no way to get into it anymore
02:16Okay
02:18beautiful
02:19That's it. So that's about disabled and that's a one global property among many
02:23So it's just one more than I wanted you to see right now and we'll continue on
