Results 1 to 5 of 5

Thread: Buttons working in forms

  1. #1
    Join Date
    Aug 2005
    Posts
    200
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Buttons working in forms

    Here is a form that i wrote. Im pretty sure that my scripting is correct but no guarentees. With the button for submitting I would like to have it mail directly to my E-mail address by clicking on the submit button and nothing else. I would also like to know what page they would get after they clicked the submit button. Thanks for the help. JF


    <html>
    <body>
    <hr color="003466">
    <form name="reg" action="mailto:E-mail" method="post" encrypt="text/plain">

    <!--e-mail address of the recipient -->
    <input type="hidden" name="email" value="E-mail">

    <table with="100%">
    <tr>
    <td width="100">
    First Name

    </td>
    <td>
    <input type="text" name="fname" id="fname" size="30">
    Last Name
    <input type="text" name="lname" id="lname" size="30">
    </td>
    </tr>

    <table width="100%">
    <tr>
    <td width="100" valign="top">
    <label for="comments">Questions or Comments</label>
    </td>
    <td valign="top">
    <textarea name="comments" id="comments" rows="6" cols="50" wrap="hard">
    </textarea>
    </td>
    </tr>


    <tr>
    <td width="100">
    E-mail Address
    </td>

    <td>

    <input type="text name="e-mailaddress" id="e-mailaddress">
    <!-- Buttons -->
    <tr>
    <td valign="top" colspan="2" align="center">
    <input type="submit" value="Send">
    <input type="reset" value="Reset">
    </td>
    </tr>

    </table>
    </form>
    <hr color="003466">
    </body>
    </html>

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Freeman
    With the button for submitting I would like to have it mail directly to my E-mail address [...]
    Use a server-side form processor to do this. The mailto scheme is not reliable. There are plenty of free services available, though your host may supply its own.

    <hr color="003466">
    Hexadecimal colour values must be prefixed by a hash (#) character: #003466. A later horizontal rule (hr) also has this problem, too.

    <form name="reg" action="mailto:E-mail" method="post" encrypt="text/plain">
    I doubt you need a name attribute, and there is no encrypt attribute anywhere in HTML. There is an enctype attribute for forms, but its use is rarely necessary (file uploads, usually).

    <input type="hidden" name="email" value="E-mail">
    A decent form processor will not require you to include your e-mail address in the markup. If you are told to include it, you should check that using a different address (perhaps a temporary Yahoo! account) will cause the submission to fail. There have been some badly written scripts over the years which could be hijacked for sending spam. No-one should use them, but it doesn't hurt to make sure.

    <table with="100%">
    Typo: width, not with.

    </tr>

    <table width="100%">
    This is invalid markup: the table element here must either be separate, in which case you should close the previous one, or it must be completely contained within a cell.

    <input type="text name="e-mailaddress" id="e-mailaddress">
    You missed the closing quote for the type attribute value.

    Hope that helps,
    Mike

  3. #3
    Join Date
    Aug 2005
    Posts
    200
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Now that i have fixed the little mistakes how do I make it send to a cgi site. I have on set up now is it <form name="reg" action="http://www.website.com/cgi/mailer" method="post"> Is this the correct way to have it send to my cgi account? Thanks for all the help. JF

  4. #4
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Freeman
    [...] how do I make it send to a cgi site. I have on set up now is it <form name="reg" action="http://www.website.com/cgi/mailer" method="post"> Is this the correct way to have it send to my cgi account?
    It's entirely dependent upon the particular script; they're all different.

    What service are you using? Do they not provide instructions?

    Mike

  5. #5
    Join Date
    Aug 2005
    Posts
    200
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well it turs out that after I posted that last message I found the instrucions on their site. Thanks for the help. JF

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •