Тёмный
No video :(

Form validation and simple application in javascript 

Hitesh Choudhary
Подписаться 935 тыс.
Просмотров 52 тыс.
50% 1

Welcome to a youtube channel dedicated to programming and coding related tutorials. We talk about tech, write code, discuss about cloud and devops. That’s what we do all day, all year. We roll out a lot of series and videos on our channel.
All the learning resources such as code files, documentations, articles and community discussions are available on our website:
chaicode.com/
You can find our discord link, github link etc on the above website.
Twitter/X link: x.com/hiteshdo...
Discord link: hitesh.ai/discord
Learn React with 10 projects: • Let's learn react from...
Learn Docker: • A practical guide on D...
Learn Kubernetes: • Complete Kubernetes Co...
How does a browser works: • How does a browser wor...
How nodejs works: • How node JS works | En...
Learn Redux-toolkit: • Learn Redux Toolkit in...
Learn NextJS: • Nextjs Full stack course
Learn Typescript: • Why to learn Typescript
Learn Javascript: • Welcome to new JavaScr...
Learn React Native: • React Native Mastery: ...
Learn Zustand: • React state management...
Learn Golang: • How to get started wit...

Опубликовано:

 

29 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 71   
@sachinbharadwaj4682
@sachinbharadwaj4682 6 лет назад
Happy Labour day @hithesh :)
@pavantejavydhik7354
@pavantejavydhik7354 6 лет назад
thank you looking for this since long time. lots of love as usual, pls keep encouraging.
@Denzil3386
@Denzil3386 5 лет назад
In the start of this video, you said that you've taught how to add listener for buttons. But, I've watched all the videos prior to this and it doesn't look like you taught that. Please check again and let us know. Thanks! :)
@hardik.motwani
@hardik.motwani 5 лет назад
see the playlist in LearnCodeOnline website, you can find the link in description, all the videos are present there in order, in youtube's playlist some videos are missing
@mohinijadhav5985
@mohinijadhav5985 5 лет назад
I thing Currently in may-19 lot of session is missing from this play list and its getting worst due to disorderliness in play list please make it correct you are good teacher and it'll really efficient we learn in sequential order Thank you.
@HiteshCodeLab
@HiteshCodeLab 5 лет назад
This series is available for free with community discussion at courses.learncodeonline.in
@shrutib7705
@shrutib7705 5 лет назад
function myValidation(){ let myVal =document.getElementById('myForm').value; if(isNaN(myVal)|| myVal < 1 || myVal >20){ let changeP=document.querySelector('#one') changeP.textContent="not valid input" } else{ let changeP=document.querySelector('#one') changeP.textContent="input OK" } }
@Abhishekkumar-hf6xp
@Abhishekkumar-hf6xp 6 лет назад
Back to back two video 😍
@piyushgarg4341
@piyushgarg4341 5 лет назад
function valid(){ let value = document.getElementById('box').value; alert(typeof value) if(isNaN(value) || value20 ) { alert("Login Done") } else if(name=''){ alert("try agin") } } //console.log(`${name}`) This is treating value as a string!! what should i do????????????
@piyushgarg4341
@piyushgarg4341 5 лет назад
And shows login done everytime
@dharmendraprasad198
@dharmendraprasad198 6 лет назад
We love u sir. Nd love this series
@zsoltventilla5999
@zsoltventilla5999 4 года назад
If I understood assignment appropriately: function myValidation() { let myValue = document.getElementById('myform').value let valueToChange = document.getElementById("idone") /* let myValue = document.querySelector('#myform').value let valueToChange = document.querySelector("#idone") */ valueToChange.textContent = myValue } Interesting: if input text is empty / or filled with spaces only(!) /, then second line is deleted, and all the lines below first line are shifted up.
@zsoltventilla5999
@zsoltventilla5999 4 года назад
I misunderstood the assignment a little bit. ( I do not know how to delete youtube comment...)
@dharmeshchowdhary
@dharmeshchowdhary 10 месяцев назад
The videos are jumbled after you started web structures and JS in the playlist. Some are not there in the playlist.
@torgal786
@torgal786 5 лет назад
document.querySelector('#myform').addEventListener('input',(event) => { console.log('Your age is : ' +event.target.Value); } )
@ProtechBD1
@ProtechBD1 3 года назад
i am following your all vedio dada.please pray for me
@fabienbedogue527
@fabienbedogue527 6 лет назад
if (isNaN(myValue) || myValue < 1 || myValue > 20) { document.getElementById("idone").innerHTML = "Not a valid input " } else { document.getElementById("idone").innerHTML = "This input is ok" }
@nagendra9092
@nagendra9092 5 лет назад
Thank you, I had a question By taking multiple inputs in FORM like name, age, number, after clicking on submit it will appear on new page with name:xyz, number:123456. with edit option also can we make like this with only using java script. please make a video on this. thank you
@nishchaysharma5904
@nishchaysharma5904 4 года назад
Here goes the assignment: function myValidation() { let myValue = document.getElementById('myform').value if(isNaN(myValue) || myValue20) document.querySelector("#idone").textContent = 'Not a valid input' else document.querySelector('#idone').textContent = "This input is OK!" }
@ayushmanbt
@ayushmanbt 6 лет назад
Should I use "onclick" event or "addeventlistener" for performing some action on button click?
@HiteshCodeLab
@HiteshCodeLab 6 лет назад
Both are totally fine
@crunckNATIon
@crunckNATIon 6 лет назад
i prefer addEventListener....but thats just me
@hardik.motwani
@hardik.motwani 5 лет назад
i spent my whole day figuring out the difference in onclick and addeventlistener, i was not getting answer then i came to know onclick is inline and addevent listener is separate, addevent listener is better i guess, im not sure
@surajitdan3727
@surajitdan3727 6 лет назад
@Hitesh Sir i can't figure out how to solve the assignment......please help
@ajaybediya634
@ajaybediya634 3 года назад
Writing the script only here... var output = document.getElementById("idone"); var input = document.getElementById("myform"); var btn = document.querySelector("button"); btn.addEventListener("click", function(e) { var value = input.value; output.innerText = (isNaN(value) || value < 1 || value > 20) ? "Invalid Input" : "Valid Input"; }); ============================================================================ I have used Ternary Operator Syntax: condition ? value1 : value2; Here value1 will be used if the condition evaluates to true or value2 otherwise.
@jayantsaxena2671
@jayantsaxena2671 4 года назад
Sir, as per your last assignment my code is changing the text only for once, if we try to change the text again by changing the input it is giving type error can you explain why
@elle9834
@elle9834 4 года назад
Are numbers in the input classified as strings or intiger values?
@stackdeveloper6614
@stackdeveloper6614 6 лет назад
Form validation with JS or with PHP?? Which one is preferred ?
@gr8bhavin1000
@gr8bhavin1000 5 лет назад
Hii I need help to generate 5 random number using js and at the end addition of 5 random numbers plz help
@vishwasyadav6775
@vishwasyadav6775 4 года назад
let sum = 0; for(i=0;i
@kabalida3062
@kabalida3062 6 лет назад
Bro seriously what is best java or JavaScript or PHP or python and I am so confused what should it take ...😵
@pegallapatimamaswini7660
@pegallapatimamaswini7660 4 года назад
const myPElement = document.querySelector('change') change.textContent= 'not valid input'
@rabindrajoshi9258
@rabindrajoshi9258 6 лет назад
function validate() { let newText; let value = document.querySelector('#search').value; let modifier = document.querySelector('#modifyMe'); if (isNaN(value) || value < 1 || value > 20) { newText = "Invalid Entry" } else { newText = "WOWW"; } modifier.textContent = newText }
@sumit6350
@sumit6350 6 лет назад
Hi I am getting an Error The tag 'FORM [method=GET]' requires including the 'amp-form' extension JavaScript. I am non technical guy can you help me how to solve it
@vineethreddy7433
@vineethreddy7433 4 года назад
document.querySelector('#text1').addEventListener('input',(event)=>{ let a2=document.querySelector('#p1').innerHTML=event.target.value if(a2>=1&&a2
@AnuragArwalkar
@AnuragArwalkar 5 лет назад
where is the previous video
@ParthKandpal
@ParthKandpal 5 лет назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-QedZL8kXX6Y.html check it here
@sachinnegi7188
@sachinnegi7188 5 лет назад
fggg
@hometv4061
@hometv4061 3 года назад
@@ParthKandpal thankss man
@ParthKandpal
@ParthKandpal 3 года назад
@@hometv4061 you're welcome
@aiswarya5848
@aiswarya5848 5 лет назад
In which vedio the listener is mentioned??
@vishwasyadav6775
@vishwasyadav6775 4 года назад
function myValidation(){ let myValue = document.querySelector('#myform').value; if (isNaN(myValue)|| myValue < 1 || myValue > 20) { let text = document.querySelector('#html') text.textContent = 'not a valid input'; } else{ text = document.querySelector('#html') text.textContent = 'this was ok'; } }
@elle9834
@elle9834 4 года назад
theres no `change` in MDN for some reason.
@mradulgupta9626
@mradulgupta9626 6 лет назад
Hey hitesh, got a doubt When we are getting the value by getElementById function why are we not using # before the id name, Like why don't we write let myValue = document. getElementById( '#myForm' ).value.
@crunckNATIon
@crunckNATIon 6 лет назад
Mradul Gupta Mradul Gupta dont need the "#" hashtags in js when getting element by id....the hashtag is used in css to signify the id attribute in the html element in order to style it...it would be repetitive to use it in getElementById() method....and querySelector() is used to select an css rule ...there you can use an ". or #" to signify class or id. but in cases of getElementsByClass(), or getElementById() those are not needed and would probably cause a syntax error
@mradulgupta9626
@mradulgupta9626 6 лет назад
crunckNATIon thanks for the explanation.
@jayatibanerjee4107
@jayatibanerjee4107 4 года назад
const myelement = document.getElementById('Idone') console.log( myelement.textContent = 'not a valid input');
@DvaitAdvaitAdda
@DvaitAdvaitAdda 4 года назад
again one more video containing listener (click ..)missing or misplaced..so m not able to understand this video
@kelvinaziken5383
@kelvinaziken5383 4 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-QedZL8kXX6Y.html
@yournadanvlog
@yournadanvlog 6 лет назад
Which is your text editor?
@sanjithsivapuram2227
@sanjithsivapuram2227 4 года назад
function myValidation() { let myValue = document.getElementById('myform').value if (isNaN(myValue) || myValue < 1 || myValue > 20) { console.log('Not a valid input'); const myPElements = document.getElementById('idone'); myPElements.textContent = "Not a valid input" } else { console.log('This input is ok'); const myPElements = document.getElementById('idone'); myPElements.textContent = "This input is ok" } }
@vivekrk5946
@vivekrk5946 4 года назад
Osm dude
@kabalida3062
@kabalida3062 6 лет назад
Bro I don't understand the condition myvalue20
@akshaykumarchavan383
@akshaykumarchavan383 6 лет назад
if(isNaN(myValue) || myValue < 1 || myValue > 20){ let valid = document.querySelector('#idone') valid.textContent = 'not a valid input' } else { let valid = document.querySelector('#idone') valid.textContent = 'this input is ok' }
@sanjithsivapuram2227
@sanjithsivapuram2227 4 года назад
function myValidation() { let myValue = document.querySelector('#myform').value console.log(myValue); }
@vivekchavan3170
@vivekchavan3170 6 лет назад
Google AIY kit ke bare me plz video ya phir tutorial banao
@pramodpatil9768
@pramodpatil9768 4 года назад
function myvalidation(){ let myvalue=document.getElementById('myform').value; if (isNaN(myvalue) || myvalue20) { const newpara= document.querySelector('#idone').innerHTML='not valid input' console.log(newpara) } else{ const newpara=document.querySelector('#idone').innerHTML='this was ok' console.log(newpara) } }
@sumitrabaskey6379
@sumitrabaskey6379 6 лет назад
👍
@kabalida3062
@kabalida3062 6 лет назад
Bro what is different between JavaScript and PHP language
@hamzafaysal909
@hamzafaysal909 6 лет назад
JS is for client side and PHP is for server side...
@crunckNATIon
@crunckNATIon 6 лет назад
Js is for interactivity and validation before it goes to the server...php actually can fetch SQL and other data from data from server and api, encrypt data, connect you to rdbms...wheres as in js you use noSql db and nodejs, express...also alot of different languages can be used for backend, but the three main langs for frontend devs are html,css, and js
@ufranahmed7776
@ufranahmed7776 4 года назад
function myValidation(){ let myValue = document.querySelector('#mytextbox').value; if(isNaN(myValue) || myValue < 1 || myValue > 20){ // console.log('invalid input') document.querySelector('#res').textContent = 'this is an invalid input' document.querySelector('#res').style.color = "red"; } else{ // console.log('this is a valid input'); document.querySelector('#res').textContent = 'this is a valid input' document.querySelector('#res').style.color = "green"; } }
@kabalida3062
@kabalida3062 6 лет назад
I think condition must be myvalue >1//myvalue
@vivekrk5946
@vivekrk5946 4 года назад
No.... Here in if part we are looking for not a valid input so it's correct as mentioned in video
@prashanthkumar0
@prashanthkumar0 6 лет назад
console.log=function(dat){ document.querySelector("#idone").innerHTML=dat; } //😋😋😋😋 //how is my solution 😊😊 .. i am prototyping 😺
@kritikasinghal282
@kritikasinghal282 5 лет назад
Please tell me why this is correct I am not able to know the logic
@shashank664
@shashank664 4 года назад
I forgot about it when I was doing the assignment, Thanx @Prashanth ❤️ @Kritika .innerHTML fatches the value from the given thing (#idone in the above example) and replaces it with whatever you put in front of equal sign (he used dat function in this example)
@mohitkarkar8774
@mohitkarkar8774 6 лет назад
//assignment function myValidation(){ let myvalue = document.querySelector('#myform').value; if (isNaN(myvalue) || myvalue < 1 || myvalue > 20 ) { document.querySelector('#idone').textContent = "Not a valid input" }else { document.querySelector('#idone').textContent ="this input is ok"; } }
@CODERSNEVERQUIT
@CODERSNEVERQUIT 6 лет назад
3rd
@himanshurathi1242
@himanshurathi1242 Год назад
function myValidation(){ let myValue = document.querySelector('#myform').value if (isNaN(myValue) || myValue 20){ var text1 = "Not a valid response" console.log(text1); }else { var text1 = "This is okkk" console.log(text1) } //only to change the text of p const myP = document.querySelector('p') myP.textContent = text1 }
Далее
Advance form validation in javascript
9:52
Просмотров 31 тыс.
Username and Password checking basics in javascript
15:36
Oh No! My Doll Fell In The Dirt🤧💩
00:17
Просмотров 12 млн
مسبح السرير #قصير
00:19
Просмотров 2,5 млн
Maps and for of loop in javascript
22:35
Просмотров 44 тыс.
#26 Form Validations in JavaScript
12:25
Просмотров 508 тыс.
Methods and this keyword in javascript
13:55
Просмотров 62 тыс.
Classes and objects in javascript
16:30
Просмотров 82 тыс.
JavaScript Form Validation
6:39
Просмотров 896 тыс.
Arrays and Template literals in javascript
13:24
Просмотров 71 тыс.
Arrow function basics in javascript 😃
13:41
Просмотров 65 тыс.
Oh No! My Doll Fell In The Dirt🤧💩
00:17
Просмотров 12 млн