[thelist] Preview In Progress

Christian Heilmann lists at onlinetools.org
Wed Nov 24 14:10:30 CST 2004


Rob Smith wrote:

>Hey,
>
>I need to be able to have a button on my form, preferably NOT a submit
>button, that will take text in a textarea or text field and display a popup
>of text parsed in HTML format...
>
><input type="image" src="grfx/Preview.gif" value="Preview" alt="Preview"
>title="Preview" onClick="alert(edit_feature.ArticleTitle.value);"> 
>... or onClick="window.open(edit_feature.ArticleTitle.value)"
>
>I'm at a loss, can you shed some light?
>
>Rob Smith
>  
>
image is the same as a submit, it will send off the form. You could 
circumvent that by adding return false to your  event handlers. However, 
to render the output as HTML you'd need to open and close  the document 
in the window. A better option is to read the value and set it as the 
innerHTML value of an element in the page, this also  means you need no 
popup!





More information about the thelist mailing list