Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 19th, 2008, 10:39 PM
Authorized User
Join Date: Feb 2008
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default JavaScript Problem in CMS

I am facing a problem with Javascript.
I am working with content management system,
here an Admin can add a new content with text,images,etc..
while doing this i want to add a Text as hyperlink.

If we want to add a image then we will click the image button it brings a small popup window, there u can browse the image. The image url will be placed in a textbox, then the image will be place in the content once u have clicked the ok button.

This is sample javascript for the above example.

var elmLink;
var intAlignment;
var htmlSelectionControl = "Control";
var globalDoc = window.dialogArguments;
var grngMaster = globalDoc.selection.createRange();

idstr = "\" id=\"556e697175657e537472696e67"; // new image creation ID

if (!txtFilevideo.fLinkLoaded)
    grngMaster.execCommand("InsertImage", false, idstr);
    elmLink = globalDoc.all['556e697175657e537472696e67'];
    grngMaster.moveStart("character", -1);

elmLink.src = txtFilevideo.value;

similarly I want to click a image button it should bring a popup window, there I can browse the image.
The image url should be placed in one textbox and the Name of the Image should be typed in another textbox.
If I click ok button the Name should be placed inside the content as Hyperlink. If I click the hyperlink
it will open the image separately.

How the globalDoc.seletion.CreateRange() is working and what is the need of idstr.

I have tried a a lot with the above script, I don't know where I am struggling. Can anyone tell me how to full fill my requirement.

similar example scripts available here.


Similar Threads
Thread Thread Starter Forum Replies Last Post
CMS problem trieuanhl BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 5 November 23rd, 2008 05:38 AM
CMS Envelope problem chapter 9 luke.koziol BOOK: Beginning Cryptography with Java 1 May 6th, 2007 05:15 PM
Instant Results - CMS Admin Problem NickNelson BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 November 30th, 2006 04:49 PM
CMS Login problem Codescribler BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 24 April 24th, 2006 02:58 PM
CMS anshul Pro PHP 2 May 30th, 2005 01:22 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.