This commit is contained in:
2023-05-07 20:29:00 +05:30
parent 52e0800ce7
commit 75a91cc670
3 changed files with 78 additions and 70 deletions

View File

@@ -10,7 +10,10 @@ export default function addSchoolForm() {
"status":"published",
name: event.target.schoolName.value,
country: event.target.country.value,
anual: event.target.anual.value,
toddlers: event.target.toddlers.value,
early_start_programme: event.target.early_start_programme.value,
interakto: event.target.interakto.value,
}
const JSONdata = JSON.stringify(data)
const endpoint = 'https://management.beanstalkedu.com/items/school'
@@ -23,8 +26,8 @@ export default function addSchoolForm() {
}
const response = await fetch(endpoint, options)
const result = await response.json()
alert(`Is this your full name: ${result.data}`)
// const result = await response.json()
// alert(`Is this your full name: ${result.data}`)
}
return (
<main>
@@ -39,7 +42,7 @@ export default function addSchoolForm() {
<form onSubmit={handleSubmit} className='w-full px-6 md:px-20'>
<div className='flex flex-col w-full'>
<label htmlFor="school" className='text-xl font-bold'>School Name</label>
<input type="text" name="schoolName" placeholder='School Name' className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
<input type="text" name="schoolName" placeholder='School Name' className='border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
</div>
<div className='flex flex-col w-full pt-4'>
<label htmlFor="country" className='text-xl font-bold'>Country</label>
@@ -47,7 +50,7 @@ export default function addSchoolForm() {
</div>
<div className='flex flex-col w-full pt-4'>
<label htmlFor="anual" className='text-xl font-bold'>Anual</label>
<select name="anual" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
<select name="anual" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
<option value="0" selected>-Select-</option>
<option value="January">January</option>
<option value="February">February</option>
@@ -65,25 +68,25 @@ export default function addSchoolForm() {
</div>
<div className='flex flex-col w-full pt-4'>
<label htmlFor="toddlers" className='text-xl font-bold'>Toddlers</label>
<select name="toddlers" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
<option value="0" selected>-Select-</option>
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
</select>
<select name="toddlers" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
<option value="0" selected>-Select-</option>
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
</select>
</div>
<div className='flex flex-col w-full pt-4'>
<label htmlFor="early_start_program" className='text-xl font-bold'>Early Start Program</label>
<select name="early_start_program" id="early_start_program" className='bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
<label htmlFor="early_start_programme" className='text-xl font-bold'>Early Start Program</label>
<select name="early_start_programme" id="early_start_programme" className='bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
<option value="0" selected>-Select-</option>
<option value="January">January</option>
<option value="February">February</option>
@@ -118,7 +121,7 @@ export default function addSchoolForm() {
</select>
</div>
<div className='flex justify-center pt-8'>
<button type='submit' className='bg-[#FE4501] hover:shadow-2xl hover:shadow-[#F2B705] p-2.5 rounded-lg px-10 rounded-tl-full rounded-br-full hover:scale-110 active:scale-75 duration-200 text-xl font-bold text-white cursor-pointer'>Submit Now</button>
<a href="/school-list"><button type='submit' className='bg-[#FE4501] hover:shadow-2xl hover:shadow-[#F2B705] p-2.5 rounded-lg px-10 rounded-tl-full rounded-br-full hover:scale-110 active:scale-75 duration-200 text-xl font-bold text-white cursor-pointer'>Submit Now</button></a>
{/* <input type="submit" value="Submit Now" className='bg-[#FE4501] hover:shadow-2xl hover:shadow-[#F2B705] p-2.5 rounded-lg px-10 rounded-tl-full rounded-br-full hover:scale-110 active:scale-75 duration-200 text-xl font-bold text-white cursor-pointer' /> */}
</div>
</form>
@@ -127,5 +130,4 @@ export default function addSchoolForm() {
</div>
</main>
)
}
}