Skip to content

Fix phone number input field validation #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
29 changes: 27 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,17 @@ <h2 class="headline-1 text-center">Online Reservation</h2>
<div class="input-wrapper">
<input type="text" name="name" placeholder="Your Name" autocomplete="off" class="input-field">

<input type="tel" name="phone" placeholder="Phone Number" autocomplete="off" class="input-field">
<input
type="tel"
name="phone"
placeholder="Phone Number"
autocomplete="off"
class="input-field"
pattern="[0-9+-]+"
title="Please enter only numbers and symbols (+, -)"
inputmode="numeric"
onkeypress="return (event.charCode >= 48 && event.charCode <= 57) || event.charCode === 43 || event.charCode === 45"
>
</div>

<div class="input-wrapper">
Expand Down Expand Up @@ -1114,7 +1124,7 @@ <h3 class="card-title title-2 text-center">
Subscribe us & Get <span class="span">25% Off.</span>
</p>

<form action="" class="input-wrapper">
<!-- <form action="" class="input-wrapper">
<div class="icon-wrapper">
<ion-icon name="mail-outline" aria-hidden="true"></ion-icon>

Expand All @@ -1126,6 +1136,21 @@ <h3 class="card-title title-2 text-center">

<span class="text text-2" aria-hidden="true">Subscribe</span>
</button>
</form> -->

<form action="" class="input-wrapper" id="subscribeForm">
<div class="icon-wrapper">
<ion-icon name="mail-outline" aria-hidden="true"></ion-icon>
<input type="email" name="email_address" placeholder="Your email" autocomplete="off" class="input-field" id="emailInput" required>
</div>

<button type="submit" class="btn btn-secondary">
<span class="text text-1">Subscribe</span>
<span class="text text-2" aria-hidden="true">Subscribe</span>
</button>

<!-- Success Message -->
<p id="successMessage" class="success-message" style="display: none;">Successfully Subscribed!</p>
</form>

</div>
Expand Down