Form validation and simple application in javascript

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 พ.ย. 2024

ความคิดเห็น •

  • @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

  • @pavantejavydhik7354
    @pavantejavydhik7354 6 ปีที่แล้ว

    thank you looking for this since long time. lots of love as usual, pls keep encouraging.

  • @Denzil3386
    @Denzil3386 5 ปีที่แล้ว +1

    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

  • @sachinbharadwaj4682
    @sachinbharadwaj4682 6 ปีที่แล้ว +4

    Happy Labour day @hithesh :)

  • @shrutib7705
    @shrutib7705 5 ปีที่แล้ว +1

    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"
    }
    }

  • @dharmeshchowdhary
    @dharmeshchowdhary ปีที่แล้ว

    The videos are jumbled after you started web structures and JS in the playlist. Some are not there in the playlist.

  • @nagendra9092
    @nagendra9092 5 ปีที่แล้ว +1

    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

  • @ayushmanbt
    @ayushmanbt 6 ปีที่แล้ว +1

    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

  • @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...)

  • @stackdeveloper6614
    @stackdeveloper6614 6 ปีที่แล้ว

    Form validation with JS or with PHP?? Which one is preferred ?

  • @Abhishekkumar-hf6xp
    @Abhishekkumar-hf6xp 6 ปีที่แล้ว +1

    Back to back two video 😍

  • @elle9834
    @elle9834 4 ปีที่แล้ว

    Are numbers in the input classified as strings or intiger values?

  • @sanjithsivapuram2227
    @sanjithsivapuram2227 4 ปีที่แล้ว +1

    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"
    }
    }

  • @torgal786
    @torgal786 5 ปีที่แล้ว +1

    document.querySelector('#myform').addEventListener('input',(event) => {
    console.log('Your age is : ' +event.target.Value);
    }
    )

  • @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!"
    }

  • @kabalida3062
    @kabalida3062 6 ปีที่แล้ว

    Bro seriously what is best java or JavaScript or PHP or python and I am so confused what should it take ...😵

  • @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

  • @piyushgarg4341
    @piyushgarg4341 6 ปีที่แล้ว +1

    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 6 ปีที่แล้ว

      And shows login done everytime

  • @dharmendraprasad198
    @dharmendraprasad198 6 ปีที่แล้ว

    We love u sir. Nd love this series

  • @yourmvlog
    @yourmvlog 6 ปีที่แล้ว

    Which is your text editor?

  • @surajitdan3727
    @surajitdan3727 6 ปีที่แล้ว +2

    @Hitesh Sir i can't figure out how to solve the assignment......please help

    • @ajaybediya634
      @ajaybediya634 4 ปีที่แล้ว

      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.

  • @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

  • @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
    }

  • @ProtechBD1
    @ProtechBD1 3 ปีที่แล้ว

    i am following your all vedio dada.please pray for me

  • @vineethreddy7433
    @vineethreddy7433 4 ปีที่แล้ว

    document.querySelector('#text1').addEventListener('input',(event)=>{
    let a2=document.querySelector('#p1').innerHTML=event.target.value
    if(a2>=1&&a2

  • @Bertoed
    @Bertoed 6 ปีที่แล้ว +1

    if (isNaN(myValue) || myValue < 1 || myValue > 20) {
    document.getElementById("idone").innerHTML = "Not a valid input "
    } else {
    document.getElementById("idone").innerHTML = "This input is ok"
    }

  • @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.

  • @aiswarya5848
    @aiswarya5848 5 ปีที่แล้ว

    In which vedio the listener is mentioned??

  • @vishwasyadav6775
    @vishwasyadav6775 4 ปีที่แล้ว +1

    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';
    }
    }

  • @gr8bhavin1000
    @gr8bhavin1000 5 ปีที่แล้ว +1

    Hii I need help to generate 5 random number using js and at the end addition of 5 random numbers plz help

  • @AnuragArwalkar
    @AnuragArwalkar 6 ปีที่แล้ว +2

    where is the previous video

    • @ParthKandpal
      @ParthKandpal 6 ปีที่แล้ว +3

      th-cam.com/video/QedZL8kXX6Y/w-d-xo.html check it here

    • @sachinnegi7188
      @sachinnegi7188 5 ปีที่แล้ว

      fggg

    • @hometv4061
      @hometv4061 3 ปีที่แล้ว +1

      @@ParthKandpal thankss man

    • @ParthKandpal
      @ParthKandpal 3 ปีที่แล้ว

      @@hometv4061 you're welcome

  • @pegallapatimamaswini7660
    @pegallapatimamaswini7660 4 ปีที่แล้ว

    const myPElement = document.querySelector('change')
    change.textContent= 'not valid input'

  • @vivekchavan3170
    @vivekchavan3170 6 ปีที่แล้ว

    Google AIY kit ke bare me plz video ya phir tutorial banao

  • @kabalida3062
    @kabalida3062 6 ปีที่แล้ว

    Bro I don't understand the condition myvalue20

  • @elle9834
    @elle9834 4 ปีที่แล้ว

    theres no `change` in MDN for some reason.

  • @jayatibanerjee4107
    @jayatibanerjee4107 4 ปีที่แล้ว

    const myelement = document.getElementById('Idone')
    console.log(
    myelement.textContent = 'not a valid input');

  • @DvaitAdvaitAdda
    @DvaitAdvaitAdda 5 ปีที่แล้ว +1

    again one more video containing listener (click ..)missing or misplaced..so m not able to understand this video

    • @kelvinaziken5383
      @kelvinaziken5383 4 ปีที่แล้ว

      th-cam.com/video/QedZL8kXX6Y/w-d-xo.html

  • @sanjithsivapuram2227
    @sanjithsivapuram2227 4 ปีที่แล้ว

    function myValidation() {
    let myValue = document.querySelector('#myform').value
    console.log(myValue);
    }

  • @kabalida3062
    @kabalida3062 6 ปีที่แล้ว

    Bro what is different between JavaScript and PHP language

    • @hamzafaysal909
      @hamzafaysal909 6 ปีที่แล้ว +1

      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

  • @mohitkarkar8774
    @mohitkarkar8774 6 ปีที่แล้ว +4

    //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";
    }
    }

  • @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";
    }
    }

  • @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'
    }

  • @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)
    }
    }

  • @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)

  • @sumitrabaskey6379
    @sumitrabaskey6379 6 ปีที่แล้ว

    👍

  • @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

  • @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
    }