Skip to main content
Participant
January 1, 2009
Question

Is there a way to hide email on view source when validation error found using validateAt = onServer?

  • January 1, 2009
  • 1 reply
  • 577 views
I'm confused!

Here's what I'm doing. I have two seperate files, one is form.cfm and one is formdo.cfm.

On form.cfm, I have the cfform, that takes a name, email, phone number, and message and is set with validateAt onSubmit and onServer with correct syntax in the code. the cfform action is set to formdo.cfm.

formdo.cfm is the other file that handles all the form data and uses cfmail to send it to an email address. formdo.cfm grabs all the input fields from form.cfm and shoots out an email with all the form inputs. I've tested all of this and it sends an email and the form contents as it should.

So next, I tested the onServer validation with Javascript off, and sure enough it told me I had an error and to go back and fix it.
Good there, except when I viewed the source on the server validation page, it shows the email address in English even when encoded with the character entities. However, if you just call this file up by it's URL/formdo.cfm it shows the character entities that I entered. I know this is because the server has already interpreted it but I'm wondering if spambots can steal that 'interpreted' email address and I don't especially like the fact that a real person can view it in source of the server validation page. (since I viewed the email address myself in plain english in the source of the server validation.)

So how can I hide this email besides character entities? Or are there any other anti-spambot considerations that someone could offer me?
Thanks for reading this!

Some additional info on the code in formdo.cfm (syntax is correct in actual code but written out here):
cfmail to = email_as_character_entities
from = POUND_Email_From_Last_Page_POUND
This topic has been closed for replies.

1 reply

Inspiring
January 2, 2009
> except when I viewed the source on the server validation page, it shows the email address in English

Where are you seeing the form field values in the validation page? All I see is plain html.


<html>
<head>
<title>Form entries are incomplete or invalid.</title>
</head>
<body>

<table border="1" cellpadding="3" bordercolor="#000808" bgcolor="#e7e7e7">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0" width="500">
<tr>
<td id="tableProps2" align="left" valign="middle">
<h1 id="textSection1" style="COLOR: black; FONT: 13pt/15pt verdana">
Form entries are incomplete or invalid.
</h1>
</td>
</tr>
<tr>
<td id="tablePropsWidth" colspan="2">
<font style="COLOR: black; FONT: 8pt/11pt verdana">
<ul><li>Error in email text.
</li></ul> Go <a href="javascript:history.back()">back</a> and correct the problem.
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>

</body>
</html>
Participant
January 2, 2009
I got it going now, although I gave up my character entities (which I could've swore were working before I made this minor change.)
So here's what happened. CF was throwing an 'hidden error' in the source... it didn't like that email string length wasn't 0 or more characters. Which got me wondering how that could be if I entered something like 'invalid' in the email box, why doesn't that qualify as 7 characters? So then I tried putting a space in the cfparam for the email="" to now being email = " " now theres a space in between quotes... and that helped a little but then didn't really because it was still showing the email with the entities. Okay, sort of there. Then, I realized is that I left out all of the isNot possibilities, so I plugged all those in, and bam!, no more email in the source! Actually, a whole lot less in the source, just my 'thank you for the message' message without even a reference to email OR the cf error in the source! Pretty cool! Well, thanks anyhow for responding anyhow because it's good to know someone is willing to help! Oh btw, this was all on CF8.