this is my html form
<div class="contact_from">
<form action="#" method="post" id="contact_form">
<!-- Message Input Area Start -->
<div class="contact_input_area">
<div class="row">
<!-- Single Input Area Start -->
<div class="col-md-12">
<div class="form-group">
<input type="text" class="form-control" name="name" id="name" placeholder="Your Name" required>
</div>
</div>
<!-- Single Input Area Start -->
<div class="col-md-12">
<div class="form-group">
<input type="email" class="form-control" name="email" id="email" placeholder="Your E-mail" required>
</div>
</div>
<!-- Single Input Area Start -->
<div class="col-md-12">
<div class="form-group">
<input type="number" class="form-control" name="mobile" id="mobile" placeholder="Your Mobile" required>
</div>
</div>
<!-- Single Input Area Start -->
<div class="col-12">
<div class="form-group">
<input type="text" name="message" class="form-control" id="message" cols="30" rows="4"
placeholder="Coaching Class Name " required>
</div>
</div>
<!-- Single Input Area Start -->
<div class="col-12">
<button type="submit" id="submit" class="btn submit-btn" onclick="submitForm()">Sign Up Now</button>
</div>
</div>
</div>
<!-- Message Input Area End -->
</form>
</div>
I am trying this js function but not working
<!--Reset form values -->
<script>
function submitForm() {
var frm = document.getElementsById('contact_form');
frm.submit(); // Submit the form
frm.reset(); // Reset all form data
return false; // Prevent page refresh
}
</script>
Please tell me what should I do ?
or elsee how should I fix it by using dfferent function?