Validating script pasted in a field
<p>I want to add a textarea field to my website where users can paste a whole script into it and save it.</p>

<p>What I'm worried about is users trying to inject other code into the field.</p>

<p>This is how the script would look ... ID and hex would change but nothing else:</p>

<pre><code>&lt;script type="text/javascript"&gt;
            var advertvars_vars = {
             pubid: '00000000000', // publisher id
             bgcolor: '804296', // background color (hex)
             text: 'FFFFFF', // font-color (hex)
             test: true 
            };
&lt;/script&gt;
&lt;script type="text/javascript" src="http://mysite.com/static/ad.js"&gt;&lt;/script&gt;
</code></pre>

<p>My question is...Is there anyway of validating that the user is pasting valid code as above?</p>
