Skip to content

Commit

Permalink
Updated project form
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaditya019Jain authored Oct 14, 2023
1 parent a44fc47 commit 492e021
Showing 1 changed file with 47 additions and 25 deletions.
72 changes: 47 additions & 25 deletions frontend/src/pages/ProjectFrom.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,37 @@ import MyComponent2 from "../components/MyComponent2";
export default function ProjectForm(){

const [projectlist , setProjectlist] = useState({
title : '',
cateogary : '',
mentee_min : '',
mentee_max : '',
description : '',
timeline : '',
banner_image : '',
title: '',
abc: '',
categary: '',
mentee_min: '',
mentee_max: '',
description: '',
timeline: '',
banner_image: '',

})

const detailsChange = (e) => {
const {id,value} = e.target
setProjectlist({
...projectlist,
[id] : value,
// console.log(projectlist)
})
console.log('id:', id);
console.log('value:', value);
}

const detailsSubmit = (e) => {
console.log(projectlist)
axios.post('/api/dashboard/mentor/submit/',projectlist)
.then(res =>{
console.log(res)
}).catch(err =>
console.log(err))
}


const handleRollNumberChange = (e) => {
var roll = e.target.value ? e.target.value : null;
Expand All @@ -30,6 +51,7 @@ export default function ProjectForm(){
alert("No such user exists")
e.target.style.backgroundColor = 'red';


}
else{
e.target.style.backgroundColor = 'green';
Expand All @@ -51,7 +73,7 @@ export default function ProjectForm(){
<h1>Project Form</h1>
<form>
<label>Project Title</label>
<input type='text' id='title'/>
<input type='text' id='title' onChange={detailsChange}/>
<br></br>
<label>
Co Mentors
Expand All @@ -63,54 +85,54 @@ export default function ProjectForm(){
<br></br>
<label>
Title your project idea
<input type='text' requried/>
<input type='text' id='abc' requried onChange={detailsChange}/>
</label>
<br></br>
<div>
<h3>Project Cateogary</h3>
<label>
Select an option:
<select name="option" id='cateogary'>
<option value="WEB3">WEB3</option>
<option value="AIML">AIML</option>
<option value="DEV">DEV</option>
<option value="CP">CP</option>
<option value="MISC">MISC</option>
</select>
</label>
<select id='categary' onChange={detailsChange}>
<option value="WEB3">WEB3</option>
<option value="AIML">AIML</option>
<option value="DEV">DEV</option>
<option value="CP">CP</option>
<option value="MISC">MISC</option>
</select>
<br></br>
<br></br>
</div>
<label>
<input type='text' id='description'/>
<input type='text' id='description' onChange={detailsChange}/>
Description of the project
</label>
<br></br>
<label>
<input type='number' id='mentee_min'/>
<input type='number' id='mentee_min' onChange={detailsChange}/>
minimum number of mentees
</label>
<br></br>
<label>
<input type='number' id='mentee_max'/>
<input type='number' id='mentee_max' onChange={detailsChange}/>
maximum number of mentees
</label>
<br></br>
<label>
Prereqisite of the mentees(if any)
<input type ='text' id='abstract'/>
<input type ='text' id='abstract' onChange={detailsChange}/>
</label>
<br></br>
<label>
timeline(if any)
<input type ='text' id='timeline'/>
<input type ='text' id='timeline' onChange={detailsChange}/>
</label>
<br></br>
<label>
upload the banner of the project (as pdf)
<input type='file'id='banner_image'/>
<input type='file'id='banner_image' onChange={detailsChange}/>
</label>
</form>
<button onClick={detailsSubmit}>
Submit Project
</button>
</>
)
}

0 comments on commit 492e021

Please sign in to comment.