How to I wrap php code in javascript

Discussion in 'JavaScript' started by ashiezai, Oct 29, 2006.

  1. #1
    In order to block the bots to spam my html forms, I've tried to use captcha but failed to install it.

    Now I'm looking for ways to wrap my forms with javascript so that bots cant read them. (I've heard that bots dont deal with javascript, so ...)


    The file really a html form but it's saved as form.php:


    <form action="#" method="post">
    <table border="0" width="100%" cellpadding="3" style="border-collapse: collapse">
    <tr>
    .......
    .......
    .......
    </table></form>


    Can anyone help me to wrap the code up with javascript? Thanks alot!!
    I do not know anything about javascript so your help is much appreciated.
     
    ashiezai, Oct 29, 2006 IP
  2. TheBorg

    TheBorg Peon

    Messages:
    144
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use something like this:

    <script type="text/javascript" language="javascript">
    	document.write('<form action="#" method="post">');
    </script>
    Code (markup):
     
    TheBorg, Oct 29, 2006 IP
  3. pdxdirect

    pdxdirect Guest

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i've been searching for a quick fix! I just updated a bunch of sites and will keep my fingers crossed. I get *so* much spam from contact forms. Thanks!
     
    pdxdirect, Jan 28, 2007 IP