Jump to content

Email Form


VivienneCrow

Recommended Posts

I wanted to place a form onto my contact page of my website so that people can contact me easily, and it wont display my email address. I've found a code that does this ... but it seems rather long. Would someone mind taking a look at it to see if it's all necessary.

 

Also, I'd like to be able to change the background of the text box's and submit button to match my site, is this possible?

 

<FORM action="mailto:you@yourdomain.com" method="post" enctype="text/plain">
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="4" WIDTH="90%">
<TR>
<TD width="30%"><DIV align="right">
<B>Name:</B>
</DIV>
</TD>
<TD width="70%">
<INPUT type="text" name="name" size="20">
</TD>
</TR>
<TR>
<TD><DIV align="right"><B>Email:</B></DIV>
</TD>
<TD>
<INPUT type="text" name="email" size="20">
</TD>
</TR>
<TR>
<TD><DIV align="right">
<B>Comment:</B>
</DIV>
</TD>
<TD><TEXTAREA name="comment" cols="30" wrap="virtual" rows="4">
</TEXTAREA>
</TD></TR>
<TR>
<TD> </TD>
<TD>
<INPUT type="submit" name="submit" value="Submit">
<INPUT type="reset" name="reset" value="Reset">
</TD></TR>
</TABLE>
</FORM>

 

Thanks

 

PS And I just remembered something else ... is there anyway for these forms to work without it automatically opening Microsoft Office Outlook? Every time I test it, that's what it does.

Link to comment
Share on other sites

The form code looks basically OK. You don't need the input tag with reset as a viewer can edit what he entered in each other input box. The reset clears all entries.

 

The form uses a table which is OK but most people would now use a list.

 

The form has action to a mailto which means it has to open a viewer's email client like Outlook Express or Outlook, cannot be used from an internet cafe and mailto addresses can be harvested by spambots.

 

If you want an email form that hides your email address and doesn't need to open an email client. use a PHP form. There are plenty of scripts online, some are free.

http://www.jemjabella.co.uk/php-scripts-php-mail-form

http://www.formmail.com/

 

They usually have security measures built in to prevent spambots being a nuisance.

 

Edit: you can style input boxes and other form tags like select boxes

input { background: #eee; color: red; }

Edited by Wickham
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...