...

View Full Version : HTML test field



ayyyy
10-20-2009, 11:28 PM
Is there a way to create a message field which I would be able to

copy and paste a block of HTML into
hit a button
and a new window would pop up with that code performed?

Any guidance would be great!!

Thanks

Anthony

glenngv
10-21-2009, 08:16 PM
It's more of a Javascript question.

Try this:

<html>
<head>
<title>Preview</title>
<script type="text/javascript">
function doPreview(f){
if (f.htmlField.value){
var win = window.open("", "_blank", "width=600, height=400, resizable=1");
win.document.write(f.htmlField.value);
win.document.close();
win.focus();
}
}
</script>
</head>
<body>
<form>
<textarea name="htmlField" rows="10" cols="100"></textarea>
<input type="button" value="Preview" onclick="doPreview(this.form);" />
</form>
</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum