On Fri, 11 Mar 2005 21:55:50 GMT,
Rick Cook <rc****@TAKEOUT.mindspring.com> posted:
I would like to do a response form on one of my sites instead of posting
an e-mail address for spammers. I've taken a couple of examples from
sites, but the code looks clunky and non-conformant to my inexperienced eye.
Also, on the sites I've found you can get the e-mail address simply by
viewing the page source. It seems to me there should be a way to hide
that, but as I say I'm hardly an expert.
Look at the NMS replacements for Matt Wright's forms. They allow you to
specify an alias for the recipient in the form, and the script uses that
alias to work out which address to post to (you configure a table of
aliases and addresses in the script).
Can anyone recommend a good site to use as a pattern? Needless to say,
I'd like it to be as easy to maintain and standards compliant as possible.
That rather depends on what you want on the form. Such as answering
questions, writing messages, etc. But what sort maintenence do you need
on a form once you've written it?
A valid, and logical way, of structuring parts of forms is to use the
proper form elements, as set out in the specifications, perhaps with a
few extra formatting elements and CSS to neaten things up, and avoiding
using tables. For example:
<form action="/cgi-bin/FormMail.pl" method="post" accept-charset="us-ascii, iso-8859-1">
<fieldset>
<legend>Why did you visit this site?</legend>
<div class="multiplechoice">
<label><input type="checkbox" name="visit_reason" value="Boredom"> I needed more excitement in my life</label><br>
<label><input type="checkbox" name="visit_reason" value="Broken PC"> Trying to fix my PC</label>
</div>
</fieldset>
<fieldset>
<legend>Did the site work properly?</legend>
<div class="multiplechoice">
<label><input type="radio" name="site_okay" value="Yes"> Yes</label><br>
<label><input type="radio" name="site_okay" value="No"> No</label><br>
<label><input type="radio" name="site_okay" value="Don't know"> Don't know</label><br>
<label><input type="radio" name="site_okay" value="No answer" selected> No comment</label>
</div>
</fieldset>
<fieldset>
<legend>Your details</legend>
<div>
<label for="name">Name:</label><br>
<input type="text" name="realname" id="name" size="50" maxlength="70">
</div>
<div>
<label for="address">E-mail address:</label><br>
<input type="text" name="email" id="address" size="50" maxlength="70">
</div>
</fieldset>
<fieldset>
<legend>Message details</legend>
<div>
<label for="subject">Subject:</label><br>
<input type="text" name="subject" id="subject" size="50" maxlength="70" value="survey form response">
</div>
<div>
<label for="message">Message:</label><br>
<textarea name="message" id="message" cols="50" rows="20"></textarea>
</div>
</fieldset>
<fieldset>
<legend>Action</legend>
<div>
<input name="recipient" value="webmaster" type="hidden">
<input type="hidden" name="redirect" value="/response.html">
<input type="submit" value="Send"> your comments.
</div>
</fieldset>
</form>
Notes:
-----
1. My "multiplechoice" CSS class was there to play with margins/fonts.
2. I've deliberately made the message area big enough to write a message
without it being a pain.
--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.
This message was sent without a virus, please delete some files yourself.