PD editor insert-image

This tutorial will show you how to add an insert image and pre-view function to your PD html editor.

The 'Pre-view' button:

This button will trigger the pre-view window and change the image to the one selected in the menu.

This button holds the OnClick event called 'viewImage'.

<input type="button" name="viewimage" value="Pre-view" onClick="viewImage();">

The function is shown below and needs be inserted in the head tags:

function viewImage(){
display_window.document.image_main.src= document.all.prefix.value + document.all.imagebank.value;
display_window.window.focus();
}

This event will change the tag with the name image_main in the browser window display_window with the values of the hiddenfield prefix and the menu imagebank and sets focus to the window when we do this.

That's it !

Click here for Live Example

Note: the focus is on the texteditor in the HTML editor, so the browser window will dissapear to the back. When using pre-view the browser window will get focus. The pre-view function will only work when the browser window is open, if closed a re-load is needed.

Requirements: IE 5+

 

 

Marcellino Bommezijn

Marcellino BommezijnMarcellino Bommezijn is one of the managers at dmxzone.com. He is a contributor on the tutorials section.

Owner of Senzes Media (http://www.activecontent.nl) which provides professional services and web applications for mid-sized companies.

ActiveContent CMS is the ASP.NET Content Management solution that is used for building professional and rich-featured websites.

See All Postings From Marcellino Bommezijn >>

Comments

Thanks

November 27, 2001 by Berry van Elk
Thanks for this tutorial, i try'd a lot of things but nothing worked. This tutorial is just perfect.

Align Image?

January 14, 2002 by David Martin

I've used your method to add images...Thanks for the help. How would I go about enhancing this to be able to insert the align="left" or "right" tag? The same goes for adding a border around the image.

 

RE: Align Image?

February 26, 2002 by heinz leo

thats a big question!
do you have a answer now?

Style sheets?

March 1, 2002 by Damien Aviles
i have a style sheet on my site, i would like to keep the style sheet font and size. pd edit won't let me do that. can i have it so that the default font is the style sheet?
See all 12 Comments

You must me logged in to write a comment.