View Single Post
Old 10-08-2012, 06:07 PM   PM User | #8
alphamale
New Coder

 
Join Date: Oct 2012
Posts: 12
Thanks: 4
Thanked 0 Times in 0 Posts
alphamale is an unknown quantity at this point
Quote:
Originally Posted by xelawho View Post
here's how WolfShade's regex would work on page load:

Code:
<body>
<input id="txt" value="<pre><pre><pre><pre><pre><pre><pre><pre>Testing description field</pre></pre></pre></pre></pre></pre></pre></pre>"/>
<script type="text/javascript">
document.getElementById("txt").value=document.getElementById("txt").value.replace(/\<(\/)*pre\>/g,"")
</script>
</body>
if you have the rewrap bit sorted, you should be fine.
Okay thanks again.

Just to confirm that this would be okay?

Code:
<body>
<textarea id="description"> <?php $value['description'] ?> </textarea>
<script type="text/javascript">
document.getElementById("description").value=document.getElementById("description").value.replace(/\<(\/)*pre\>/g,"")
</script>
</body>
alphamale is offline   Reply With Quote