Hello everyone, i am very new to PHP. I’ve created a html form and I have the php script with it reference into the index file. Unfortunately when I click the submit button nothing happens.
<div class=“span9”>
<form action=“connect.php” method=“post” form id=“contact-form” class=“contact-form” action=“#”>
<p class=“contact-name”>
<input id=“contact_name” type=“text” placeholder=“Full Name” value=“” name=“contact_name”
</p>
<p class=“contact-email”>
<input id=“contact_email” type=“text” placeholder=“Email Address” value=“” name=“contact_email” />
</p>
<p class=“contact-email”>
<input id=“Groupon_number” type=“text” placeholder=“Groupon Number” value=“” name=“groupon_number” />
</p>
<p class=“contact-message”>
<textarea id=“contact_message” placeholder=“Your Message” name=“contact_message” rows=“15” cols=“40”></textarea>
</p>
<p class=“contact-submit”>
<a id=“contact-submit” input type=“submit” class=“submit”>Send Your Email</a>
</p>
<div id="response">
</div>
</form>
</div>
If it’s the HTML let me know whats wrong. please and thank you.
you don’t have a submit button, only a link.
a submit button is either
<input type="submit" value="display text">
or
<button type="submit">
// whatever the button should contain comes here
</button>
tpunt
September 5, 2014, 7:29pm
3
You also seem to have a few HTML markup errors that you may want to tend to:
<form action="connect.php" method="post" form id="contact-form" class="contact-form" action="#">
should be
<form action="connect.php" method="post" id="contact-form" class="contact-form">
I’ve omitted your second action attribute and removed the form part of form id .
Also, the following html tag isn’t being closed:
<input id="contact_name" type="text" placeholder="Full Name" value="" name="contact_name"
<form action=“connect.php” method=“post” form id=“contact-form” class=“contact-form” action=“#”>
to b <form action=“connect.php” method=“post” id=“contact-form” class=“contact-form”> and try different class and id name
I’ve changed the code, thank you guys. But now i am getting an error message that the mail-it.php file can’t be found.
<form action=“mail-it.php” method=“post” id=“contact-form” class=“contact-form”>
<p class=“contact-name”>
<input id=“contact_name” type=“text” placeholder=“Full Name” value=“” name=“contact_name”>
</p>
<p class=“contact-email”>
<input id=“contact_email” type=“text” placeholder=“Email Address” value=“” name=“contact_email” />
</p>
<p class=“contact-email”>
<input id=“Groupon_number” type=“text” placeholder=“Groupon Number” value=“” name=“groupon_number” />
</p>
<p class=“contact-message”>
<textarea id=“contact_message” placeholder=“Your Message” name=“contact_message” rows=“15” cols=“40”></textarea>
</p>
<input type=‘text’ p class=“contact-submit”> <input type=“submit” value=“Send Your Message”>
</p>
<div id=“response”>
</div>
</form
tpunt
September 6, 2014, 6:24pm
6
Where is the location of your PHP script that handles the form data? According to your form, it should be located in a file called mail-it.php that is in the same directory.