Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

The Submit Button Won't Work

Community Beginner ,
Jan 05, 2017 Jan 05, 2017

The submit button is meant to be emailing the data in the form, but isn't doing anything at all. I am aware that the mailto action is unreliable, but I'm unable to use any server side code instead of it, and I don't know of any other ways to make it send an email.

Just a quick side-note, but is there a way to redirect the user after submitting the form without using server side code?

<form action="mailto:1sportsuk2016@gmail.com" enctype="text/plain" method="post" autocomplete="on">

                        <fieldset>

                          <legend style="color: #FFFFFF; font-size:22px;">Bookings Form:                        </legend>

                        <p>

                          <input id="fname" type="text" placeholder="First Name" name="First Name" required autocomplete > ...............

                          <label for="textarea">

                               <input id="email" type="email" placeholder="Email Address" name="email" required autocomplete>

                                <input id="lname" type="text" placeholder="Last Name" name="Last Name" required autocomplete>

A r e a : </label>

                        </p>

                        <p>

                          <textarea name="Feedback" id="Feedback" maxlength="250" placeholder="Please give us your feedback about our website and our facilities in 250 characters or less." cols="63"rows="3"></textarea>

                        </p>

                        <p>                           <span style="color: #FFFFFF">Please select your gender:<span style="color: #000000">.........</span></span>  <span style="color: #FFFFFF">Male:  

                                <input name="gender" type="radio" title="Male" value="Male">

                              <span style="color: #000000">.........</span>Female:

<input type="radio" name="gender" value="Female">

                            </span><br>

                          </p>

                          <p><input type="reset">

                            <input id="submit" type="submit" value="Submit">

                    </p>

                        </fieldset>

                        </form>

1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 05, 2017 Jan 05, 2017

mailto links work by opening the computer's default email application (if one is installed) allowing the user to then send the info via that email client.

Without an installed client, nothing happens when you click Submit. Without additional scripting, the page will just sit in the background as the email client opens. There's no way to make the page go somewhere else when Submit is clicked, that actually has anything to do with whether the data has been submitted, without some kind of scripting.

...
Translate
Community Expert ,
Jan 05, 2017 Jan 05, 2017

mailto links work by opening the computer's default email application (if one is installed) allowing the user to then send the info via that email client.

Without an installed client, nothing happens when you click Submit. Without additional scripting, the page will just sit in the background as the email client opens. There's no way to make the page go somewhere else when Submit is clicked, that actually has anything to do with whether the data has been submitted, without some kind of scripting.

You "could" fake it by putting a link on the button during the onclick event that simply goes to a different page while the email client opens, but it will go to that page no matter what, whether the email client opens or not or whether the data is actually sent or not.

If you don't have php, or some other server side language available on your server (sort of an oddity these days) there are services that you can link to that will do the same thing.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 05, 2017 Jan 05, 2017

If you don't have an email client configured to open with those links nothing will happen.  And no, there is no way to redirect someone without using a script to do so.

If you don't mind me asking, why are you unable to use server-side scripting?

Also, have you considered hosted solutions?  If it is a small enough volume you may be able to squeeze into some free plans, but as you grow, hopefully your company's budget will as well so you can utilize a more comprehensive hosting solution.  One form processing script I have used before is wufoo FREE Account Signup and Pricing for Premium Plans | Wufoo  . 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 07, 2017 Jan 07, 2017
LATEST

Ben M wrote:

If you don't mind me asking, why are you unable to use server-side scripting?

I need to do this for a bit of coursework, and their network seems to have blocked any sort of server side code.

I'm still learning how to use html, so the clarification from everyone has been really helpful. Thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 05, 2017 Jan 05, 2017

HTML forms don't DO anything without help from server-side scripts. 

Ask your web host which form processing scripts you can use on your hosting plan.

If your server supports PHP  scripts, this 3-part tutorial will teach you how to create a working contact form that:

  • Conceals your email address from robot harvesters,
  • Self-validates required input fields,
  • Tests for robot submissions,
  • Sanitizes input fields & stops form exploits,
  • Shows success/error messages to your users,
  • Sends form data to your email address. 

Alt-Web Design & Publishing: Responsive Contact Form with Bootstrap 3.2 and PHP (Part 1)

Nancy

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jan 05, 2017 Jan 05, 2017

This is actually really funny. The reason your code doesn't work is the very reason you should not use mailto, which is that you don't have a mail client set up on your computer.

Your code actually works on my computer because I do have Microsoft Outlook set up.

So this should prove to you that mailto should NEVER be used.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines