Rank 4: Virtual Machine
???
Votes
1
Replies
24
Participants
Unknown
Messages
25
Rank 4: Virtual Machine
???
Rank 2: Process
import { useState } from 'react'import {database} from './appwrite_test'
export const StoreValues = () => {
const [color, setColor] = useState('red')
const handleSubmit = (e) => { e.preventDefault() database.createDocument('[DATABASE_ID]', '[COLLECTION_ID]', '[DOCUMENT_ID]', {color}).then(success => { // }).catch((welp) => { // }) }
return <form onSubmit={handleSubmit}> <input type="radio" value="red" id="colorRed" onChange={(e) => { setColor(e.target.value) }}/> <label htmlFor="colorRed" >Red</label> <input type="radio" value="blue" id="colorBlue" onChange={(e) => { setColor(e.target.value) }}/> <label htmlFor="colorBlue">Blue</label> <button type='submit'>Submit</button> </form>}something like this? @bharath
Rank 4: Virtual Machine
i have created document in another file
its much better if you have a github repo and share it with us - since issues related to this are frequent so it will be helpful ❤️
Rank 4: Virtual Machine
ok i will
Rank 4: Virtual Machine
Rank 4: Virtual Machine
here it is
Rank 4: Virtual Machine
i want to store user input from 1.signup(username,email) 2.uploadcomp(filename) 3.select(color,side-radiobuttons) 4.showprice(table-values) under one documentid
thank you for sharing, i will take a look and let you know
Rank 4: Virtual Machine
Ok
Rank 4: Virtual Machine
Did you got it
Admin
hmm i found this...https://github.com/Bharathgit5/printfc.in/blob/3ce9700da228c4a1b51620eb485c5129fa4cf99d/src/Select.js#L22
This isn't how react works. I highly recommend taking a step back to get more practice with react: https://react.dev/learn
Rank 4: Virtual Machine
What's wrong with it
Rank 4: Virtual Machine
@Steven I want to complete this project asap
Rank 4: Virtual Machine
Please help me with it
Admin
I'm sorry, you really need to take the time to learn the basics
Rank 4: Virtual Machine
Please let me know where the mistake is..
Rank 2: Process
You are not using state setters properly props.setState isn't a method + you are not using functions correctly. You should spend a week or so going through the basics again including some JS as well, then you should be at a better place to work on this project 🙂
Rank 4: Virtual Machine
On which topics should I go through
Rank 4: Virtual Machine
Basically iam new to coding its a continuous learning process
Rank 2: Process
Basics of JS and DOM
Rank 2: Process
then react
Rank 4: Virtual Machine
In react upto which topic https://react.dev/learn
Rank 2: Process
all the topics in their learn page
Admin
And maybe some tutorials on forms in react. Like https://react.dev/learn/reacting-to-input-with-state