In my web application there is a contact form where users can contact me, and send me messages but I don't know how to handle this and receive those messages.
I am attaching the screenshot of the particular "contact-me" section as well as code below.
Thanks in advance for helping me out !
<div class="text">Message me</div>
<form class="contact-form" action="#" method="POST">
<div class="fields">
<div class="field name">
<input type="text" class="fullname" placeholder="Name">
</div>
<div class="field email">
<input type="text" class="email-input" placeholder="Email">
</div>
</div>
<div class="field">
<input type="text" class="subject" placeholder="Subject">
</div>
<div class="field textarea">
<textarea class="message" cols="30" rows="10" placeholder="Message.."></textarea>
</div>
<div class="button-area">
<button class="send-msg" type="submit" name="send">Send message</button>
<div class="error-box"></div>
</div>
</form>
[contact me screenshot]
[1]: https://i.stack.imgur.com/64qQH.png
Related
I wrote this simple form that should require the users to input their phone number if the submit button is hit. Instead, nothing happens. Can someone please help me?
Here is the code for my form:
<form id="subscribeForm" method="POST" novalidate="novalidate">
<div class="payment margin-top-30">
<div class="payment-tab payment-tab-active">
<div class="payment-tab-trigger">
<input checked id="{PAYMENT_TYPES.folder}"
class="payment_method_id" name="payment_method_id"
type="radio"
value="{PAYMENT_TYPES.id}" data-name="m-pesa2">
<label for="{PAYMENT_TYPES.folder}">{PAYMENT_TYPES.title}</label>
<img class="payment-logo {PAYMENT_TYPES.folder}"
src="{SITE_URL}includes/payments/{PAYMENT_TYPES.folder}/logo/logo.png"
alt="{PAYMENT_TYPES.title}">
</div>
<div class="payment-tab-content">
<p>
A Push notification shall be sent to the Phone
Number to complete payment.
</p>
<div class="payment-tab-content">
<div class="row payment-form-row">
<div class="col-12">
<div class="card-label form-group">
<input type="text" class="form-control"
name="phone" placeholder="Phone Number" required/>
</div>
</div>
</div>
</div>
</div>
</div>
<button type="submit" name="Submit" class="button big ripple-effect
margin-top-40 margin-bottom-65 subscribeNow"
id="subscribeNow">submit</button>
</form>
Remove novalidate="novalidate" from <form>
After submitting the form nothing happens, page doesn't reloads. Out of ideas.
<form action="/departmentinsert.php" method="POST" class="contact-form">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<input class="form-control" id="name" name="name" placeholder="Отделение" type="text">
</div>
</div>
</div>
<div class="col-md-12">
<div class="row">
<button type="submit" name="submit" id="submit">
Добавить <i class="fa fa-paper-plane"></i>
</button>
</div>
</div>
</div>
</form>
to submit the form you will need to use <input type="submit"> instead of the <button> tag
once you update the code I am sure it will work, if you are using PHP it should be like this
<?php
if(isset($_POST['submit']){
// your code
}
?>
if this doesn't work please post your PHP as well so i can check where's the problem
hope this help.
I changed formatting to and it works now. My code now is
<form action="" method="POST" >
<div class="form-group">
<input class="form-group" id="name" name="name" placeholder="Отделение" type="text">
</div>
<div class="form-group">
<input class="form-group" id="title" name="title" placeholder="Заголовок" type="text" size="255">
</div>
<div class="form-group">
<input class="form-group" id="breadcrumb" name="breadcrumb" placeholder="Хлебные крошки" type="text" size="255">
</div>
<div class="form-group">
<input class="form-group" id="pagetitle" name="pagetitle" placeholder="Титул страницы" type="text" size="255">
</div>
<div class="form-group">
Опубликовать?
<input name="active" type="checkbox" value="1" checked>
</div>
<div class="form-group">
<button type="submit" name="submit" id="submit">
Добавить <i class="fa fa-paper-plane"></i>
</button>
</div>
</form>
So i was given a custom submission form HTML and CSS code template as shown below
I want to add the HTML mailto: script, so that anytime a employee enters a ticket, it will send to our help desk ticket email. My issue is i am completely lost on where to put it in the code itself so that when they click the submit now icon, it will send to the given address.
<!-- Main -->
<section id="main" class="container 75%">
<header>
<h2>Help Desk Ticket</h2>
<p>Submit a Help Desk Ticket to IT</p>
</header>
<div class="box">
<form method="post" action="#">
<div class="row uniform 50%">
<div class="6u 12u(mobilep)">
<input type="text" name="name" id="name" value="" placeholder="Name" />
</div>
<div class="6u 12u(mobilep)">
<input type="email" name="email" id="email" value="" placeholder="Email" />
</div>
</div>
<div class="row uniform 50%">
<div class="12u">
<input type="text" name="subject" id="subject" value="" placeholder="Subject" />
</div>
</div>
<div class="row uniform 50%">
<div class="12u">
<textarea name="message" id="message" placeholder="Description of Problem" rows="6"></textarea>
</div>
</div>
<div class="row uniform">
<div class="12u">
<ul class="actions align-center">
<li></a><input type="submit" value="Submit Ticket" /></li>
</ul>
</div>
</div>
</form>
</div>
</section>
All i want is for them to be able to click "submit ticket" and it will send to our company IT help desk email.
change this
<form method="post" action="#">
to this
<form action="mailto:someone#example.com" method="post" enctype="text/plain">
editing the email address with the recipient you want to send the mail to
I am hosting a site on github i.e. githubpages.AS It is a static site I used Formspree for my contact form but unfortunately it is not working with custom designed Contact form (with required parameters put in specified fields).
But finally the clicking of submit button does no action at all..
Here is the code I am implementing for the form.
<div class="col-lg-6">
<form action="action="https://formspree.io/jmscb56#gmail.com" method="POST" role="form" class="contactForm">
<div class="row">
<div id="sendmessage">Your message has been sent. Thank you!</div>
<div id="errormessage"></div>
<div class="col-lg-6">
<div class="form-group contact-block1">
<input type="text" name="name" class="form-control" id="name" placeholder="Your Name" data-rule="minlen:4" data-msg="Please enter at least 4 chars" />
<div class="validation"></div>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<input type="email" class="form-control" name="email" id="email" placeholder="Your Email" data-rule="email" data-msg="Please enter a valid email" />
<div class="validation"></div>
</div>
</div>
<div class="col-lg-12">
<div class="form-group">
<input type="text" class="form-control" name="subject" id="subject" placeholder="Subject" data-rule="minlen:4" data-msg="Please enter at least 8 chars of subject" />
<div class="validation"></div>
</div>
</div>
<div class="col-lg-12">
<div class="form-group">
<textarea class="form-control" name="message" rows="6" data-rule="required" data-msg="Please write something for us" placeholder="Message"></textarea>
<div class="validation"></div>
</div>
</div>
<div class="col-lg-12">
<!-- <input type="submit" class="btn btn-defeault btn-send" value="Send"> -->
<button type="submit" value="Send">Send</button>
</div>
<input type="hidden" name="_next" value="https://ghac-2017.github.io/#contact" />
</div>
</form>
</div>
Any help would be appreciated..As I cannot find what i felt short of..
Actually You cannot use formspree form as per your own customization , i.e. editing the basic (given/allotted) form values. It will work well when you use the given form values without your own customization , it will loose its functionality if you edit the basic layout of the given form by formspree.
<div class="row contact__main">
<div class="col-eight tab-full contact__form">
<form name="contactForm" id="contactForm" method="post" action="https://formspree.io/censored#gmail.com">
<fieldset>
<div class="form-field">
<input name="contactName" type="text" id="contactName" placeholder="Name" value="" minlength="2" required="" aria-required="true" class="full-width">
</div>
<div class="form-field">
<input name="contactEmail" type="email" id="contactEmail" placeholder="Email" value="" required="" aria-required="true" class="full-width">
</div>
<div class="form-field">
<input name="contactSubject" type="text" id="contactSubject" placeholder="Subject" value="" class="full-width">
</div>
<div class="form-field">
<textarea name="contactMessage" id="contactMessage" placeholder="message" rows="10" cols="50" required="" aria-required="true" class="full-width"></textarea>
</div>
<div class="form-field">
<button class="full-width btn--primary">Submit</button>
<div class="submit-loader">
<div class="text-loader">Sending...</div>
<div class="s-loader">
<div class="bounce1"></div>
<div class="bounce2"></div>
<div class="bounce3"></div>
</div>
</div>
</div>
</fieldset>
</form>
<!-- contact-warning -->
<div class="message-warning">
Something went wrong. Please try again.
</div>
<!-- contact-success -->
<div class="message-success">
Your message was sent, thank you!<br>
</div>
This is my website in question: https://xpmai.tumblr.com/test
According to what I see in Chrome Browser Console, the form tries to execute PHP from GitHub, but GitHub doesn't support PHP. So it failed. But the weird thing is, it's just a HTML form. The entire index.html doesn't have a single PHP code. So how can I resolve this??
Edit: To be more specific and plain, I have an HTML form. When I try to submit the form, it says PHP error. jquery-3.2.1.min.js:4 POST https://xpmai.tumblr.com/inc/sendEmail.php 404 () But in that code above, I can't figure out how to resolve it. How to like disable the PHP and make it do the POST action above?