0

Hope you can help, I am trying to knock up a contact form for my website which is HTML, styled with CSS and the email sent with PHP.

<form class="form" action="webform.php" method="post">
    <h1>Contact Form:</h1>
    <label>
    <span>Your Name:</span><input id="name" type="text" name="name" />
    </label>

    <label>
    <span>Email Address:</span><input id="email" type="text" name="email" />
    </label>

    <label>
    <span>Subject:</span><input id="subject" type="text" name="subject" />
    </label>

    <label>
    <span>Message</span><textarea id="feedback" name="feedback"></textarea>
    <input id="button" type="button" value="Submit Form" />
    </label>
</form>

Anyone help me out, can provide the link to my site if necessary.

Appreciate any help :)

2
  • Change your button type="submit" Commented Nov 29, 2013 at 10:30
  • Where is your submit button?it seems like button Commented May 31, 2016 at 6:23

5 Answers 5

3

You should use submit as the button type

<input id="button" type="submit" value="Submit Form" />

Fiddle DEMO

Sign up to request clarification or add additional context in comments.

Comments

1

See updated FIDDLE

Have you tried changing:

<input id="button" type="button" value="Submit Form" />

to:

<input id="button" type="submit" value="Submit Form" />

Alternatively, you can use:

<button id="button" >Submit Form</button>

As you have it now, input type='button' is not a valid element for form submission. For valid form elements, MDN have a great article- see the sections input and buttons

Comments

0

Change type="button" to type="submit"

<form class="form" action="webform.php" method="post">
    <h1>Contact Form:</h1>
    <label>
    <span>Your Name:</span><input id="name" type="text" name="name" />
    </label>

    <label>
    <span>Email Address:</span><input id="email" type="text" name="email" />
    </label>

    <label>
    <span>Subject:</span><input id="subject" type="text" name="subject" />
    </label>

    <label>
    <span>Message</span><textarea id="feedback" name="feedback"></textarea>
    <input id="button" type="submit" value="Submit Form" />
    </label>
</form>

2 Comments

what difference does your answer have to the answers given above?
Yep. Am using mobile internet with dial up connection.
0

In this particular case, I agree with the suggested solutions re: type="submit.

But I arrived here due to having my buttons stop working all of a sudden, though a Select submit was still working. And it was due to a tiny bug in some Javascript that was killing the submission.

Just something else to check.

Comments

-1

try this html form

<form class="form" action="webform.php" method="post">
    <h1>Contact Form:</h1>
    <label>
    <span>Your Name:</span><input id="name" type="text" name="name" />
    </label>

    <label>
    <span>Email Address:</span><input id="email" type="text" name="email" />
    </label>

    <label>
    <span>Subject:</span><input id="subject" type="text" name="subject" />
    </label>

    <label>
    <span>Message</span><textarea id="feedback" name="feedback"></textarea>
    <input id="button" type="submit" value="Submit Form" />
    </label> </form>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.