Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions public/donate-book.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,13 @@ <h2>Book Donation Form πŸ“š</h2>
<label>Contact Number</label>
</div>

<div class="user-box">
<textarea rows="4" class="form__input form-control" type="text" name="" id="address" required=""></textarea>
<label>Address</label>
<div class="user-box">
<h6>Address<h6>
<textarea row="4" class="form-control" type="text" name="" id="address" required=""></textarea>
<label for="floatingTextarea2">Address</label>
</div>


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these extra lines


<div class="user-box">
<label>Select Country: </label><br><br>
Expand Down Expand Up @@ -119,15 +122,15 @@ <h2>Book Donation Form πŸ“š</h2>
</select>
</div>
<div class="user-box">
<input class="form__input form-control" id="zip" type="text" name="" required="">
<input class="form__input form-control" id="zip" type="text" name="" required="">
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra space before required

<label>Zip</label>
</div>
<div class="user-box">
<input class="form__input form-control" type="text" name="" required="">
<input class="form__input form-control" type="text" name="">
<label>Landmark (Optional)</label>
</div>
<div class="user-box">
<input class="form__input form-control" id="alt_contact" type="text" name="" required="">
<input class="form__input form-control" id="alt_contact" type="text" name="">
<!--onchange="validate_phone(document.getElementById('alt_contact'))"-->
<label>Alternate Phone (Optional)</label>
</div>
Expand Down Expand Up @@ -223,19 +226,26 @@ <h2>Book Donation Form πŸ“š</h2>
if(input.value.match(phone)){
return true;
}
}
/*else{
alert("Please enter a valid phone number")
return false;
}*/

}






Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these extra lines


function reset_form(){
document.getElementById("donation_form").reset();

}

donationForm.addEventListener('submit',e=>{

if(validate_phone(document.getElementById('contact'))){
e.preventDefault();
const { data, error } = _supabase
Expand All @@ -255,6 +265,8 @@ <h2>Book Donation Form πŸ“š</h2>
if(res.error){
alert(res.error.message);
}


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same Remove extra lines

else{
alert('Data Added');
reset_form();
Expand All @@ -264,6 +276,8 @@ <h2>Book Donation Form πŸ“š</h2>
else{
alert("Please enter a valid phone number")
}


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

})

</script>
Expand Down