Jerontopaz pro asked 6 years ago


please i need help in validating forms ...i want to be able to get error messages when the wrong input is detected

HElp with contact form validation

Code below:

 

<form enctype=”” action=”” method=”POST” id=”” accept-charset=”UTF-8″ target=””>

<!–Grid row–>
<div class=”row”>

<!–Grid column–>
<div class=”col-md-6″>
<div class=”md-form”>
<div class=”md-form”>
<input type=”text” id=”contact-name” class=”form-control”>
<label for=”contact-name” class=””>Your name</label>
</div>
</div>
</div>
<!–Grid column–>

<!–Grid column–>
<div class=”col-md-6″>
<div class=”md-form”>
<div class=”md-form”>
<input type=”text” id=”contact-email” class=”form-control” required>
<label for=”contact-email” class=”” >Your email</label>
</div>
</div>
</div>
<!–Grid column–>

</div>
<!–Grid row–>

<!–Grid row–>
<div class=”row”>
<div class=”col-md-12″>
<div class=”md-form”>
<input type=”text” id=”contact-Subject” class=”form-control”>
<label for=”contact-Subject” class=””>Subject</label>
</div>
</div>
</div>
<!–Grid row–>
<div class=”row”>
<div class=”col-md-12″>
<div class=”md-form”>
<input placeholder=”Selected date” type=”text” id=”datepicker” class=”form-control datepicker”>
<label for=”date-picker-example”>Pick date</label>
</div>
</div>
</div>

<!–Grid row–>
<div class=”row”>
<div class=”col-md-12″>
<div class=”md-form”>
<input placeholder=”” type=”text” id=”contact-Phone” class=”form-control”>
<label for=”contact-phone”>Phone Number</label>
</div>
</div>
</div>

<!–Grid row–>
<div class=”row”>

<!–Grid column–>
<div class=”col-md-12″>

<div class=”md-form”>
<textarea type=”text” id=”contact-message” class=”md-textarea”></textarea>
<label for=”contact-message”>Reason for Appointment Request</label>
</div>

</div>
</div>
<!–Grid row–>

</form>


Mirosław Stasiak free commented 6 years ago

Hi, You forgot to add a button to approve the form. Where do you want to validate on the client or server side?

Jerontopaz pro commented 6 years ago

ON BOTH .. CLIENT AND SERVER

manojbagi free answered 2 years ago


Mirosław Stasiak free answered 6 years ago


Check this example, there is everything you need: https://mdbootstrap.com/components/bootstrap-contact-form/ Regards,

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags