0

Hi All,

I have a simple form that I want to send me an email when the button is clicked. I have two questions,
1. How can I make the fields Name and Email mandatory?
2. It does not send an email to me when used with my smartphone, which is an Android.
The code:

<form action="MAILTO:michaelmvasas@shaw.ca?subject=LC"> <br> <input type="text" name="name" value="Your Name"> <br> <br> <input type="text" name="mail" value="Your Best Email"><br> <br><br> <input type="submit" value="Submit"> </form> 

Also, you can see I have a value for each field, however, I'd rather have the fields empty and have those values just above the fields.
One last question, does the value for the submit button have to match the value that's on the button? In the code it says "Submit" but on the form itself it says Give Me Information.

Any and all help will be very much appreciated. :)

PS, This does work on my computer but for some reason the body in the email contains a long string value that I do not want there. Any idea about that?

4
Contributors
8
Replies
39
Views
1 Year
Discussion Span
Last Post by Stuugie
1

Hey Stuugi, I have an awnser to your problem;

Name: <input type="text" name="name" required>
Email address: <input type="email" name="email" required placeholder="enter valid email address ">

Votes + Comments
Thanks, I appreciate part of teh answer
1

You will need to add the 'label' element to your inputs aswell.

<form>

    <div>

        <label for="name">Name</label>
        <input type="text" name="name" placeholder="Your Name" required>

    </div>

    <div>

        <label for="email">Email</label>
        <input type="email" name="email" placeholder="enter valid email address" required>

    </div>

</form>

And set your label and input to display: block in your CSS, so that they will stack ontop of each other.

Edited by gentlemedia

Votes + Comments
Thanks, this is very helpful
0

I just read that this type of form can only be run on IE, which is not very ideal.

0

@Diafol, I am using a WordPress plugin called WP Optin so yes. However, I have (admittedly) not much experience with PHP.

0

I had to remove my version of the WP Optin because they were too buggy and I don't want buggy on my site.

1

Ok. Many email forms scripts available in PHP. Targeting a single browser is as bad as buggy though :)

Votes + Comments
I agree, thanks
1

So, I've decided to emerge myself in PHP so that I can get more functionality out of my WordPress site. Thanks Diafol for this nudge, I think it has been long overdue.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.