[pmwiki-users] Preview Button

Anno anno at shroomery.org
Fri Feb 17 18:20:00 CST 2006


 > it'll require Javascript
> support to make it work and I'm not familiar enough with form
> submission via Javascript to say how it can be done.

Like this:

A button:

<input type="button" name="preview" value="Preview" onclick="preview()" />


The script:

<script language="javascript" type="text/javascript">
function preview() {
	wikitext = escape(document.formID.textareaID.value);
	window.open('http://www.site.com/wiki/preview.php?wikitext=
'+wikitext+'','_blank','width=600,height=400,top=25,left=25,screenX=1,
screenY=1,scrollbars=yes,resizable=yes');
}

</script>

formID and textareaID have to be replaced with the proper values.






More information about the pmwiki-users mailing list