React tutorial in Hindi #17 Handle Form | checkbox | input field | select

  Рет қаралды 79,667

Code Step By Step

Code Step By Step

3 жыл бұрын

in this react js tutorial for beginners series we learn how to handle form data in react js . This video is made by anil Sidhu in the Hindi Language.
Playlist for complete React series in Hindi
link • React tutorial for beg...
code github.com/anil-sidhu/react-1...
Basic Form
Make HTML form
Add some field
Use state for field data
Submit and control form
Interview Question
Join on Insta @php.step.by.step

Пікірлер: 55
@Ankitmathur_01
@Ankitmathur_01 Жыл бұрын
Sir ap samjhate bahut achhe se ho and koi bhi part skip nhi krte. And app begining se leke chal rhe ho. Ye bahut achha lga mujhe. Dhanyabad
@Viralvlogvideos
@Viralvlogvideos Жыл бұрын
I made a form with radio buttons,checkbox,select etc.. and also made clear button which will clear the inputs from frontend and also in useState sharing it so that other students can also refer: code: import { useState } from "react"; function App() { const [name, setName] = useState(""); const [term, setTerm] = useState(false); const [who, setWho] = useState("sigma"); const [what, setWhat] = useState(""); function formFun(e) { console.log(name, term, who, what); e.preventDefault(); } function clear() { setName(""); setTerm(false); setWho("sigma"); setWhat(""); } return ( Name: setName(e.target.value)} /> I Agree setTerm(e.target.checked)} /> who are you? setWho(e.target.value)} > sigma alpha omega noob What you do? code setWhat(e.target.value)} /> art setWhat(e.target.value)} /> Click Clear ); } export default App;
@pratiksha2896
@pratiksha2896 3 жыл бұрын
Use alt+Z to wrap your code. You don't need to scroll the entire line of code.
@rahul_singh_rajput3292
@rahul_singh_rajput3292 2 жыл бұрын
Enjoying & understanding perfectly ✌.. Your explanation is Osm sir..
@sushilkumar-ef7gh
@sushilkumar-ef7gh 2 жыл бұрын
I recently got to know about your channel....you are simple awesome brother
@Mrudula1416
@Mrudula1416 3 жыл бұрын
Nice and helpful to understand react for begginer user. Thanks
@ashutoshsrivastava9807
@ashutoshsrivastava9807 11 ай бұрын
Njyoing your classes a lot...Thanks for Guidance
@user-tg9nx2ij4o
@user-tg9nx2ij4o 8 ай бұрын
You are great teacher
@mayurchaudhari4239
@mayurchaudhari4239 3 ай бұрын
Gazab sikhate ho yar aap sir man gaye apko
@amitshinde4351
@amitshinde4351 6 ай бұрын
Thanks sir, for helpful video
@codestepbystep
@codestepbystep 6 ай бұрын
Most welcome
@abhijeetnimbalkar9729
@abhijeetnimbalkar9729 3 жыл бұрын
Nice video and helpful
@Aarna_kashyap
@Aarna_kashyap 3 жыл бұрын
Very helpful
@viveksharma6230
@viveksharma6230 Жыл бұрын
Will put the "disabled" attribute under the input tag
@RajnishKumar-oj3vr
@RajnishKumar-oj3vr 2 жыл бұрын
Can we use only e.prevent??
@reactjs4278
@reactjs4278 2 жыл бұрын
Hello sir, how to clear data on form ??
@patience_creator
@patience_creator 4 ай бұрын
Disable with disabled key word. In input field
@WanderingWieSuresh
@WanderingWieSuresh 21 күн бұрын
Abhi to humare pass 3 input the agar 20 honge to kya 20 useState banana padega
@shilpasharma6894
@shilpasharma6894 2 жыл бұрын
if we want to clear all the form field by clicking the Clear button as you have mentioned in the end of video. please help with its code for clear button.
@shubhamgarg7
@shubhamgarg7 Жыл бұрын
You should try these points, I hope it will help you - (1) You can create a reset button jo aapke form ko clear krdega (2) Aap form tag mei jo Onsubmit function call kiya hai us function mei jakr wapas se values set krdo sbki fr jaise hi aap form ko submit kroge automatically form clear ho jayega kyunki aapne form submit krne ke baad sbki values fr se set krdi
@FM001
@FM001 Жыл бұрын
Clear
@AbdulRehman-bd4mb
@AbdulRehman-bd4mb 8 ай бұрын
sir without form kis tara data leta hian
@ajitrana3158
@ajitrana3158 11 ай бұрын
Sir how to clear data in form
@shorttutorials205
@shorttutorials205 Жыл бұрын
const [disableValue,setdisableValue] = useState(false); setdisableValue(true)}>Disable setdisableValue(false)}>Enable
@sauravsubba9987
@sauravsubba9987 Жыл бұрын
Where is the questions and answers? any sepreate video?
@DeepakGupta-hj2dv
@DeepakGupta-hj2dv 3 жыл бұрын
Form validation ka video bnao
@codestepbystep
@codestepbystep 3 жыл бұрын
Okay, aaj evng me bnauga
@StudyAbroadAdventures
@StudyAbroadAdventures 2 жыл бұрын
Need help e.preventDefault is creating error plz help:) "Uncaught TypeError: Cannot read properties of undefined (reading 'preventDefault')"
@StudyAbroadAdventures
@StudyAbroadAdventures 2 жыл бұрын
when I comment this, app running smoothly....
@rajaasim4474
@rajaasim4474 Жыл бұрын
e.preventDefault();
@hades5509
@hades5509 Жыл бұрын
@@StudyAbroadAdventures use e.preventDefault()
@harrypotter-ks5qj
@harrypotter-ks5qj Жыл бұрын
Sir aapne bataya nhi ki bina form ko use karae hum kaise data ko submit krenge aapne bola tha last me bataunga
@AkanshaBhardwaj-fx2zr
@AkanshaBhardwaj-fx2zr Ай бұрын
const [disableValue,setdisableValue] = useState(false); setdisableValue(true)}>Disable setdisableValue(false)}>Enable sir please check the code is correct or not..??
@GIS-Engineer
@GIS-Engineer 10 ай бұрын
Console pe kuch nahi aa raha na ho koi error aa raha
@AmanKumar-ps8th
@AmanKumar-ps8th 3 жыл бұрын
Bt how to print all data to screen Here, we only print it in console so please tell me👌
@codestepbystep
@codestepbystep 3 жыл бұрын
Just print state data. That's it
@AmanKumar-ps8th
@AmanKumar-ps8th 3 жыл бұрын
import React, { useState } from 'react'; import './App.css'; function App() { const [name, setName] = useState(""); const [tnc, setTnc] = useState(false); const [interest, setInterest] = useState(""); const abc = (e) => { e.preventDefault(); } const a = (e) => { setName(e.target.value); } const b = (e) => { setInterest(e.target.value); } const c = (e) => { setTnc(e.target.checked); } return ( handle Form In React Select Options Marvel Dc Accept Terms and Conditions Submit ) } export default App; Sir this is the code and I tried bt it is not showing the data on screen so could u please tell me where and what to right in this code so that it works.
@codestepbystep
@codestepbystep 3 жыл бұрын
@@AmanKumar-ps8th {name} Aise use kro state ko, display ho jayega
@AmanKumar-ps8th
@AmanKumar-ps8th 3 жыл бұрын
Sir yes this is working bt not on submit button . It is printing while u r filling the input box. For this i think we have to add onclick fxn in button
@codestepbystep
@codestepbystep 3 жыл бұрын
Yes, aap iss video se last wala video dekho, wha 1 flag lekr btaya h wo try kro aap
@SUNNYVLOGS812
@SUNNYVLOGS812 Жыл бұрын
what is e here?
@Anonymous04254
@Anonymous04254 Жыл бұрын
Sir, 9:05 Pe jo Awaaz aayi wo aapne kiya tha ya kuch editing error hua hai..?😄
@codestepbystep
@codestepbystep Жыл бұрын
ye bhai m soch rha tha kuch :D
@divyanshsinghbhati6026
@divyanshsinghbhati6026 Жыл бұрын
😂😂😂😂
@ManishaKumari-du4wf
@ManishaKumari-du4wf Жыл бұрын
Sir console mai warning aa rahi hai : unknown event handler property 'onSumit'.it will be ignored
@m.pcreations2122
@m.pcreations2122 Жыл бұрын
It's onSubmit not onSumit
@ashok-bhaargaw
@ashok-bhaargaw 9 ай бұрын
Hi Anil, I have #Question. I created this form but when I checked the thems and conditions it showing me undefined. Why??
@RadheyNameKaSahara
@RadheyNameKaSahara 4 ай бұрын
Hi sir, Your voice is really soo sexy, this is a compliment don't take it wrong.😂
@codestepbystep
@codestepbystep 4 ай бұрын
Hehe.thnx
@dipukumar3472
@dipukumar3472 3 жыл бұрын
Sir aap ki insta id not found aa raha he
React tutorial in Hindi #18 Conditional rendering | If Condition
8:11
Code Step By Step
Рет қаралды 76 М.
React tutorial in Hindi #19 Basic Form validation
17:39
Code Step By Step
Рет қаралды 118 М.
Wait for the last one! 👀
00:28
Josh Horton
Рет қаралды 125 МЛН
#36 : Handling Complex Multiple Input Form States in React JS in Hindi
22:51
React tutorial in Hindi #38 Send Data Child to Parent Component
9:24
Code Step By Step
Рет қаралды 75 М.
Learn React In 30 Minutes
27:16
Web Dev Simplified
Рет қаралды 1,3 МЛН
React tutorial in Hindi #40 useMemo Hook
8:51
Code Step By Step
Рет қаралды 96 М.
Complete React Form Validation using Formik & Yup in Hindi🔥
32:49
Thapa Technical
Рет қаралды 117 М.
React tutorial in Hindi  #20 Pass Function as Props
8:08
Code Step By Step
Рет қаралды 63 М.
ReactJS Tutorial - 21 - Basics of Form Handling
13:49
Codevolution
Рет қаралды 591 М.
React tutorial in Hindi  #21 What is life cycle method
6:08
Code Step By Step
Рет қаралды 76 М.