PDA

View Full Version : xml mailto: changed to javascript to prevent spam


dantra
04-27-2007, 03:54 AM
I created a document using Acrobat Designer with a submit button. How do change the XML that the form created. It's a mailto:, I would like to change that so spammers won't read the e-mail. Here is what the document created

<submit format="xml" target="mailto:someone@somewhere.com?subject=Submission From Registration Form To &quot;my final destination&quot; (here)" textEncoding="UTF-8"/>


I would like to create a mailto: in JavaScript so I won't get spammed but don't know how to implement it back into the document.
here is what i have so far:

<script language="JavaScript">
<!--
var name = "someone";
var domain = "somewhere.com";
document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
document.write(name + '@' + domain + '</a>');
// -->
</script>


I would also like to know how to change a regular hyperlink to xml so it will show up as a link in the doucment but in a xml language that it understands. (hope i made myself clear).:confused:

Alex Vincent
04-27-2007, 02:23 PM
I don't know the answer to the first question, but if I'm reading your question right, XLink was written to answer the second.

http://www.w3.org/tr/xlink

You need the xlink namespace declared in your document, xlink:type="simple" and xlink:href="wherever you want the user to go".

(Note I could be wrong; document.write() doesn't work for XML documents.)

dantra
04-27-2007, 05:33 PM
Thanks for your help Alex. I was able to find alot of information on xlink:type="simple" and xlink:href. Idid change the relevent information in the document however, its making the form behave erratically. Adobe Acrobat is a pain.

I also looked at some other options that were suggested to me, like I was advised to ,"NEVER allow a destination address to be specified in a mail form. It should ALWAYS be resolved on the server."

That sounds like the way to go but my coding skills are limited to xhtml css and I'm barely scratching the surface with JavaScript. I'm using an apache server.

Any suggestions

dantra
04-27-2007, 06:51 PM
I am going to continue this at the php section of this forum.
Thanks for your help, I definitely learned a few things about xml (xlink:type="simple" and xlink:href).

If only this was a perfect world ;)