Form Validation Easy Using HTML And CSS Only

  Рет қаралды 31,297

Lun Dev Code

Lun Dev Code

Күн бұрын

Пікірлер: 150
@lundeveloper
@lundeveloper 3 ай бұрын
Form validation is eazy with HTML and CSS. Don't forget to like and subscribe to the channel to continuously update interesting videos about programming and web design 😍
@manthankanani188
@manthankanani188 3 ай бұрын
Extend this with html attr pattern and boom!!
@lundeveloper
@lundeveloper 3 ай бұрын
With just over 10 lines of CSS, we can validate the form easily and beautifully
@anuvabkumarrit4669
@anuvabkumarrit4669 3 ай бұрын
Not possible for complex I suppose, like those with options and specific regular expression
@dmitrybelov5703
@dmitrybelov5703 3 ай бұрын
How about :user-invalid / :user-valid? More suitable pseudo
@gmarsenopoulos
@gmarsenopoulos 3 ай бұрын
Amazing video!! My answer: If you put :not(placeholder-shown) then the button would be disabled only when the user enters invalid data in the inputs. Without it, you can disable the button from the start if any of the input fields are invalid.
@lazy-hero.
@lazy-hero. Ай бұрын
Yep your right 👍🤍
@lundeveloper
@lundeveloper 3 ай бұрын
Topic for next video: What neither Grid nor Flex CSS can do? Subscribe to be the first to see it 😍 ✅✅
@egadirgaa
@egadirgaa 3 ай бұрын
i love how you make html and css look so awesome
@mateod700
@mateod700 3 ай бұрын
i love this sound effects throught your videos
@lundeveloper
@lundeveloper 3 ай бұрын
Thanks bro 😍
@jeandearme32
@jeandearme32 2 ай бұрын
I hate them, annoying after a while
@freakfreak786
@freakfreak786 Ай бұрын
@@jeandearme32 no
@hameeeed5992
@hameeeed5992 3 ай бұрын
Great video.
@lundeveloper
@lundeveloper 3 ай бұрын
First comment 😍
@utsavjaiswal007
@utsavjaiswal007 3 ай бұрын
Because we want button should be disabled by default. When user enters correct data then it should be enabled. BTW I love your content... The way you showed the power of html and css... 🔥
@HuynhLuong227
@HuynhLuong227 2 ай бұрын
wow, pro tips, thanks for sharing
@MarkupMaverick
@MarkupMaverick 3 ай бұрын
Great video.👍Consider using the pseudo classes :user-valid and :user-invalid, that will make the placeholder trick obsolete.🙂
@lundeveloper
@lundeveloper 3 ай бұрын
Thank you bro, but The reason I haven't been introduced to :user-valid in this video is because many browsers are not yet supported so it cannot be used in real projects.
@drumlinbeatpaul
@drumlinbeatpaul Ай бұрын
Great video, thank you. Simple and does just what I need.
@muhammadadnanrazaqadri
@muhammadadnanrazaqadri 3 ай бұрын
You are Great Bro Thanks for this Type Of Content Please Continue making this type of video
@freakfreak786
@freakfreak786 Ай бұрын
I love how you admire simplicity. For me, that makes you a top tier channel
@glennwarindu4580
@glennwarindu4580 3 ай бұрын
BRO😱😱😱I marvellled once I came accross your channel you are a genius thank GOD for you
@tolgaflashtr2855
@tolgaflashtr2855 3 ай бұрын
That's an awesome trick 💯💯
@social_klauts
@social_klauts 2 ай бұрын
I Love your Videos. Great Work.
@roshanaslam7480
@roshanaslam7480 3 ай бұрын
Great video keep it up
@philathea
@philathea 2 ай бұрын
From the way you present your videos it's like you will be good movie script writer or game developer, you damn good ❤
@sol____-_-
@sol____-_- 3 ай бұрын
Nice.
@luisdavidmartinezfundora8224
@luisdavidmartinezfundora8224 3 ай бұрын
This is just amazing ❤
@keshav2kumar
@keshav2kumar 3 ай бұрын
Very nice
@thezaidushaikh
@thezaidushaikh 3 ай бұрын
Your Content is next level
@redswordz9131
@redswordz9131 3 ай бұрын
this is very handy! i didn't know 'required' existed in html! really good and straightforward as always.
@SwitchSwift12
@SwitchSwift12 3 ай бұрын
Amazing content 😊
@vanshchauhan5340
@vanshchauhan5340 3 ай бұрын
100k soon ❤
@PicSta
@PicSta 3 ай бұрын
Man, another great video with awesome, easy and entertaining valuable content. Thanks for your good work again. Have a nice day, Hoangho!
@lundeveloper
@lundeveloper 3 ай бұрын
Thank you brother
@franckngoubounkou9930
@franckngoubounkou9930 3 ай бұрын
You are very dangerous .High level .
@georgikyshenko4380
@georgikyshenko4380 3 ай бұрын
This channel is gold!
@lundeveloper
@lundeveloper 3 ай бұрын
Thanks bro 😘
@angryllamaa
@angryllamaa 3 ай бұрын
Now i can flex my skills to my friends
@DavideMaiolo
@DavideMaiolo 3 ай бұрын
Love that trick with the placeholder shown ! didnt know this is possible :D I guess we dont want that on the submit button since the submit button should also be shown as disabled no matter if the placeholder is shown or not. We only want to loose the disabled look once all inputs are valid
@emmaeli-m2u
@emmaeli-m2u 3 ай бұрын
G.O.A.T. [greatestOfAllTime]
@MustaPha-s4i
@MustaPha-s4i 3 ай бұрын
The best i love your vidéo
@lundeveloper
@lundeveloper 3 ай бұрын
😍😍😍😍 Thanks for watching my content ❤️
@besuccessfull1891
@besuccessfull1891 3 ай бұрын
Your designs are beautiful please make a video for that tooo, how do you choose the design plzz a make a video on design course🙏🙏
@tanvirkabir47
@tanvirkabir47 3 ай бұрын
Just wow 🤯
@lundeveloper
@lundeveloper 3 ай бұрын
Thank you brother 🤤🤤🤤
@amitmallick4915
@amitmallick4915 3 ай бұрын
I have been watching your videos since you started the channel. Your channel is a real gem. I kindly request that you make a complete multifunctional website using only HTML and CSS.
@lundeveloper
@lundeveloper 3 ай бұрын
Thank you very much, I will keep trying
@jayvee-official
@jayvee-official Ай бұрын
hey.. I thought it might be useful for my project 👍
@LuffyD-u7l
@LuffyD-u7l 3 ай бұрын
Nice
@okforcoding
@okforcoding 3 ай бұрын
Great video bro ❤
@lundeveloper
@lundeveloper 3 ай бұрын
Thank you for watching my content brother ❤️
@peterbaerts
@peterbaerts 3 ай бұрын
Nice video Small hint, with the pattern and title Attributes, any regular expression can be used to validate input. 😊
@AirmanCS
@AirmanCS 3 ай бұрын
First I love this channel, second pls do a image comparison only using CSS that looks nice like the java query input event ones, if not clear the ones that have like a line in the middle and you move it to see 2 images one on top of each other, also I would love if you consider using your real voice even if it is the thickest of accents ever, if it is hard I would add some subs but there is something about the AI voice that throws me off a bit 😅
@YINREX-24
@YINREX-24 3 ай бұрын
bro you are great
@lundeveloper
@lundeveloper 3 ай бұрын
Thank you bro
@Anonymous34958
@Anonymous34958 3 ай бұрын
Thanks for the awesome video. Please try to make some js videos too
@kodeeshwarar2301
@kodeeshwarar2301 3 ай бұрын
I love this Simple hacks
@lundeveloper
@lundeveloper 3 ай бұрын
😍
@andphysics4318
@andphysics4318 3 ай бұрын
please make a series of backend programming I want to learn this from you.
@lundeveloper
@lundeveloper 3 ай бұрын
I Will
@andphysics4318
@andphysics4318 3 ай бұрын
@@lundeveloper thank you master , I'll be waiting for the series
@denizorsel1029
@denizorsel1029 3 ай бұрын
I like the effort you put into this video but doing form validation with html and css only makes sense for simple forms like a login interface. Let's say you want to do it on a survey form with conditions, quotas, loops and there it immediately stops making sense to push the logic on css but drive it on a platform with a focus (eg. formik etc..) Yes we would still display styled outcomes through css but the logic needs to stay in js sphere.
@jerickojamestano626
@jerickojamestano626 3 ай бұрын
thanks
@mr.masolov1611
@mr.masolov1611 Ай бұрын
Great idea, but has a HUGE flaw called "insect element"
@johnlloydtenido6915
@johnlloydtenido6915 3 ай бұрын
IMO.This is more complicated than using javascript :D
@yourherper
@yourherper 3 ай бұрын
I love your channel, tell me how many years you spend with css and html?
@lundeveloper
@lundeveloper 3 ай бұрын
Thank you very much, even though this channel has just been established, please believe in the content I share. I learned to code HTML & CSS when I was 13 years old (2010)
@AlexCernat
@AlexCernat Ай бұрын
better is to use :user-valid and :user-invalid; they aren't new anymore, so the support is great now!
@treshi
@treshi 3 ай бұрын
Answer: Because you're changing the button relative to the input:invalid which doesn't require you to specify :not since you're not changing anything on the input field and the button only needs to know if the field is valid or invalid. (I guess )
@tibba69
@tibba69 2 ай бұрын
In a form with failed validation, how can I block the submit button if it is BEFORE all the inputs? You only show when submit button is after all inputs. Great video by the way.
@BliitzPint
@BliitzPint 2 ай бұрын
Answer: Because it's not necessary ;) When it's valid, it's valid :) And only then we care. Nice trick by the way. Is "placeholder-shown" widely supported by the browsers? How about working with ":has". Would that make it even easier?
@DeepJasoliya
@DeepJasoliya 3 ай бұрын
Because we only want enable submit button when inputs are completely valid
@JanMitLuca
@JanMitLuca 3 ай бұрын
Answer: Because we want the button to be only clickable once all required inputs are valid. Empty inputs are invalid as shown in the video.
@king82823
@king82823 3 ай бұрын
1:45 how to quick select every props 😲
@FullStack-s8g
@FullStack-s8g 3 ай бұрын
Bro use user-valid instead of valid same for invalid 😊
@ionsula141
@ionsula141 3 ай бұрын
The shopping cart script you did before was very good. Can I add product size option?
@lundeveloper
@lundeveloper 3 ай бұрын
Yes You Can 😍
@ionsula141
@ionsula141 3 ай бұрын
@@lundeveloper Hi there. can you please add this function for me? I would pay you a fee for this. I have email you with detail
@DinahLang-y4g
@DinahLang-y4g 3 ай бұрын
@@lundeveloper Hi I mailed you with detail. thanks
@mattdaus5715
@mattdaus5715 3 ай бұрын
This is an oversimplification of most form validation. It's considered best practice not to disable the submit button but allow users to fail and tell them why their submission was invalid. Something not possible with CSS unless you have some very specific CSS selectors, even then there's accessibility to take into account but based on the colors in the design it looks like that wasn't a consideration for this client. I think there is a use for simple validation like this but for complex sites or apps this usually won't cut it.
@roshplays21
@roshplays21 Ай бұрын
HWY HWY can u teach us how u made that background please
@muhammadadnanrazaqadri
@muhammadadnanrazaqadri 3 ай бұрын
Please Make Video On Switching Dark To Light or Light to dark mode using HTML CSS ONLY (without JS or any other language)
@lundeveloper
@lundeveloper 3 ай бұрын
Of course you can, but if you only use HTML and CSS you won't be able to remember the last option the user chose. If that's not important to you, everything will be very easy
@muhammadadnanrazaqadri
@muhammadadnanrazaqadri 3 ай бұрын
@@lundeveloper ok then can you make a course for js
@gandhirajs7055
@gandhirajs7055 3 ай бұрын
because when you focus the button placeholder is gone and button turn into normal state and what happen when you enter the page what will be the submit button pointer event is none or auto?
@alin7295
@alin7295 3 ай бұрын
My Answer: You have not used the :not(:placeholder-shown) for the button as the written style will only be applied whenever the user writes something in the input . My Suggestion for other viewers: It(using :not(:placeholder-shown)) can also be useful in different cases. It helps us to create a default custom style of the button,e.g., to set the default color not to be red
@awaken-trigger
@awaken-trigger 3 ай бұрын
Is there any way to get data of gmail and numbers etc.. of users with only html, css without no backend. 😢 Help..... please
@Aguinaldowagas
@Aguinaldowagas 3 ай бұрын
if submit is input ? add (:placeholder-shown) : false;
@_u_nknownuser
@_u_nknownuser 3 ай бұрын
explain plss
@mohdamir914
@mohdamir914 Ай бұрын
You didn't use input with placeholder in last line of code in css because we already checked the validation while typing and now its successfully filled so just need to check if it is valid or not. Correct?
@joel-rg8xm
@joel-rg8xm 3 ай бұрын
Uhmm :not(:placeholder-shown) ... ¿Because we want to disable the button all the time (when the text inputs are empty and when they are invalid as well)?
@nirban7689
@nirban7689 3 ай бұрын
Not add placeholder shown property at last because first time when user not enter any data submit button looks kind of disable
@PLAGUEDOCTOR-28
@PLAGUEDOCTOR-28 2 ай бұрын
I need a tutorial to make login page pls
@roydeljoseph
@roydeljoseph 3 ай бұрын
This is amazing... But not gonna lie...LOW-KEY I feel bro got it out for javascript....like he finna prove it nah all that and he can do the same with CSS
@wtf_vish
@wtf_vish 3 ай бұрын
hey bro, can you make a front-end website as a reference as i have hackathon in about 10 days. Please use html and css only.
@psenej
@psenej 3 ай бұрын
what about tailwind css ?
@UAP_Clips
@UAP_Clips 3 ай бұрын
because you need the button to be active after the placeholder is not shown
@requenz_
@requenz_ 3 ай бұрын
It looks good, but the HTML code can be removed if you open the Devtools by pressing F12.
@lundeveloper
@lundeveloper 3 ай бұрын
That's right, like I said at the beginning of the video. When users want to cheat, Devtools can help them pass validation not only for HTML but also for Javascript
@requenz_
@requenz_ 3 ай бұрын
@@lundeveloper What about PHP?
@PicSta
@PicSta 3 ай бұрын
@@requenz_ PHP is a server sided validation. Validation with PHP is a must, before you write data to your database. Like prevent from SQL injection or any other vulnerable content.
@codeSlay-yv4wq
@codeSlay-yv4wq 2 ай бұрын
Bro where do you find those background images
@jeandearme32
@jeandearme32 2 ай бұрын
I like the content, but those musical sounds are absolutely irritating
@lundeveloper
@lundeveloper 2 ай бұрын
Thanks for your feedback, I'm adjusting it.
@wordspace121
@wordspace121 3 ай бұрын
Just a quick question You validated password with minlength attribute Wouldn't it be risky if someone goes to inspect element and change that attribute value?
@aluexpress987
@aluexpress987 3 ай бұрын
Last question why you don't need not:placeholderShown because button tag has no placeholder.
@PicSta
@PicSta 3 ай бұрын
A button has no placeholder shown state. Initially, we want the button only be active, when all fields are validated as correct.
@flash27s
@flash27s 3 ай бұрын
Sir, can you please tell me, which theme of vs code are you using in this video?
@lundeveloper
@lundeveloper 3 ай бұрын
@@flash27s This is a custom theme, you will find a video about it in the description of this video.
@Rodrigo-nx4fg
@Rodrigo-nx4fg 3 ай бұрын
Bro, the fart sound makes me happier 😂
@lundeveloper
@lundeveloper 3 ай бұрын
hahaa
@madhavanj998
@madhavanj998 3 ай бұрын
How to change the text "please fill this field"
@nobie-art
@nobie-art 3 ай бұрын
Can't the validation issue before the user enters anything be easily fixed by using user-valid and user-invalid?
@lundeveloper
@lundeveloper 3 ай бұрын
Yes, using user-valid would be much simpler, however there are still too many browsers that do not support user-valid. So it is not recommended to use user-valid in real projects.
@lucadetomi9269
@lucadetomi9269 3 ай бұрын
Why not use ":user-invalid" instead of the more complex concatenated selector?
@Crix-X982
@Crix-X982 3 ай бұрын
Plz awnser your own question Because i want to know
@DavideMaiolo
@DavideMaiolo 3 ай бұрын
I guess we dont want that on the submit button since the submit button should also be shown as disabled no matter if the placeholder is shown or not. We only want to loose the disabled look once all inputs are valid
@Crix-X982
@Crix-X982 3 ай бұрын
Bro I was comented that why we not use :not(placeholder-shown) Then you asked this question 😅
@lundeveloper
@lundeveloper 3 ай бұрын
😅😅 Please wait a moment, I believe someone will reply soon. 😍
@masar-at
@masar-at Ай бұрын
VS Code theme name?
@MithilaChiranjeewa
@MithilaChiranjeewa 3 ай бұрын
Bro what is your vs code them name?
@lundeveloper
@lundeveloper 3 ай бұрын
This is a custom theme by me. You will find information about it in the description of this video
@NehaV-ly5hk
@NehaV-ly5hk 3 ай бұрын
Which theme are you using in VS code?
@lundeveloper
@lundeveloper 3 ай бұрын
You can find it in description this video
@Nodsaibot
@Nodsaibot 3 ай бұрын
sudden chello cords gives us anxiety lol bye
@_MrThii
@_MrThii 3 ай бұрын
Can you activate subtitles
@lundeveloper
@lundeveloper 3 ай бұрын
It is being processed
@h3llloworld
@h3llloworld 2 ай бұрын
because a button doesn't have a placeholder
@Impact_TO
@Impact_TO 3 ай бұрын
The sounds 😭😭😭 i cant
@lundeveloper
@lundeveloper 3 ай бұрын
is it bad?
@Impact_TO
@Impact_TO 3 ай бұрын
@@lundeveloper no i love it. Fart sounds will never not make me laugh
@KsaR-99
@KsaR-99 3 ай бұрын
But you know, "a@a" is valid e-mail in html?
@thelfensdrfer
@thelfensdrfer 3 ай бұрын
Because it is a valid email.
@KsaR-99
@KsaR-99 3 ай бұрын
​ @thelfensdrfer Technically yes, in practice no. All the (public) e-mail addresses requires an TLD e.g. ".com", ".net" etc. at the end. So this isn't valid public e-mail.
@thelfensdrfer
@thelfensdrfer 3 ай бұрын
@@KsaR-99 why does it have to be public?
@KsaR-99
@KsaR-99 3 ай бұрын
​@@thelfensdrfer Let's say it's register form, newsletter or soever. You want public address to send verification code on correct address, or deliver newsletter. And this tutorial seems to aim web-development (and not localhost). So in short "a@a" will work on "local host" but not on -- public pages; In that case (It's not security because it is easy to workaround) to improve "required" attribute can be used in conjunction with the pattern="" attribute.
@thelfensdrfer
@thelfensdrfer 3 ай бұрын
@@KsaR-99 there are more networks than localhost and the public internet. Intranets, company networks, etc.
@bw-dude
@bw-dude 3 ай бұрын
Had to quit after 30 seconds, that silly AI-voice and the absolutely annoying sound effects make it unwatchable for me. Why do you ruin good content with that?
@DanSmith-ku3wn
@DanSmith-ku3wn 3 ай бұрын
Nice videos, but oh man these sound effects... Totally random and not classy. Please stop :(
@PaulAllsopp-rh5gb
@PaulAllsopp-rh5gb 28 күн бұрын
How funny! Try validating an email address without JS now that the HTML5 email type was basically abandoned. Now HTML5 says user@server is a valid email, and even adding a pattern doesn't work. You have to use JS, period.
@choujiakimichi
@choujiakimichi 3 ай бұрын
No thank you...Dev tools can easily remove all forms of security from the form 😞😞😞
@Wanstudio_est
@Wanstudio_est 3 ай бұрын
Are you Mr beast
@bohdanvoznyi3599
@bohdanvoznyi3599 3 ай бұрын
What is this sounds bro 😭
@lundeveloper
@lundeveloper 3 ай бұрын
It is bad ?
@khuslenkk1560
@khuslenkk1560 3 ай бұрын
freaky 👅​ sound effects @@lundeveloper
Variables in CSS - Level Up variables with Propery
10:21
Lun Dev
Рет қаралды 39 М.
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
Improve your form validation hints without JS!
12:46
Kevin Powell
Рет қаралды 68 М.
Top 10 Best Tips Shared By Master CSS
13:59
Lun Dev
Рет қаралды 14 М.
CSS-Only Page Transitions That Will BLOW Your Mind!
4:13
Hemant Dutta
Рет қаралды 7 М.
How To Make Collapsible Using HTML CSS Only | No Javascript
10:57
Customize Your VS Code Like a Pro 🔥
11:51
Shreyas Sihasane
Рет қаралды 288 М.
The HTML Tags They NEVER Taught You
7:39
Giodev
Рет қаралды 155 М.
Make Awesome SVG Animations with CSS // 7 Useful Techniques
12:20
You Suck At Accessibility (But You Don't Have To)
13:23
Web Dev Simplified
Рет қаралды 63 М.
CSS Tips And Tricks I Wish I Knew Before
12:12
Lama Dev
Рет қаралды 496 М.
I Redesigned the ENTIRE YouTube UI from Scratch
19:10
Juxtopposed
Рет қаралды 929 М.