VivienneCrow Posted June 19, 2010 Report Share Posted June 19, 2010 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. Quote Link to comment Share on other sites More sharing options...
Wickham Posted June 19, 2010 Report Share Posted June 19, 2010 (edited) 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 June 19, 2010 by Wickham Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.