简体   繁体   中英

How to have a hidden form field appear with a form action of mailto?

I'm trying to make a form for a web design class. The form action HAS to be a mailto. The form also needs a hidden field that pops up after I hit the submit button. Everything looks nice so far, but after I upload my file to the school server, nothing happens after I click the submit button. I'm not to sure what's causing the problem. Here's my code:

<form action="mailto:email@example.com" method="GET" enctype="text/plain"> 
    <fieldset>
        <legend><strong>Vote Your Favorite Month(s)!</strong></legend> <br/>
        <input type="checkbox" name="votemonth" value="Jan"> January | 
        <input type="checkbox" name="votemonth" value="Feb"> February | 
        <input type="checkbox" name="votemonth" value="Mar"> March <br/><br/>
        <input type="hidden" name="success-link" value="thankyou.html">
        <p><input type="submit" value="Submit"> <input type="reset" value="Restart"></p>
    </fieldset>
</form>

I have the thankyou.html file in the same location of this file. I've tried changing up email addresses, using POST, taking out the enctype, changing the location of the hidden input type, but none of that changed anything.

Hidden fields work just like any other field.

The basic problem is that mailto: as a form action does not work well enough to use on the WWW. It only works if the visitor has an unlikely combination of compatible browser and default email client.

If you have that combination of software, then the data in the field will be included in the generated email.

Submitting a mailto: form will not cause the browser to load a new HTML document.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM