Hey I am having trouble with a script.

Discussion in 'JavaScript' started by stiqan, Jun 12, 2007.

  1. #1
    www.affiliatecloakmagic.com/error.html

    I think you know what the script is about, I'd love for someone to make it happen.. It's not working the way I want it to. It's supposed to create a <HTML> code in the textarea.. can someone post the code or if you know of a similar code that does the same and generates the same outcome :)
     
    stiqan, Jun 12, 2007 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    You're getting "unterminated string error".
    Add a '\' at the end of each line for your onClick value:

    
        <input type="button" value="Give me the Code!" onClick="document.signupid.result.value='&lt;HTML&gt;&lt;HEAD&gt;\n\n\
    &lt;TITLE&gt;'+document.signupid.vendorid.value+'&lt;/TITLE&gt;\n\
    &lt;SCRIPT&gt;window.status=&quot; &quot;;&lt;/SCRIPT&gt;\n\n\
    &lt;META http-equiv=&quot;Refresh&quot; content=&quot;0;url='+document.signupid.id.value+'&quot;&gt;\n\n\
    &lt;/HEAD&gt;&lt;BODY&gt;\n\
    Loading page...&lt;br&gt;&lt;br&gt;If this page does not load within 5 seconds please &lt;a href=&quot;'+document.signupid.id.value+'&quot;&gt;click here&lt;/a&gt;\n\n\
    &lt;/BODY&gt;&lt;/HTML&gt;\n';document.signupid.result.select();">
    
    Code (markup):
     
    ajsa52, Jun 12, 2007 IP