Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > .NET Framework 2.0
|
.NET Framework 2.0 For discussion of the Microsoft .NET Framework 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 2.0 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, 01:47 PM
Authorized User
 
Join Date: Feb 2008
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with Javascript in Content Management

Hi,
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.

Example:
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'];
    elmLink.removeAttribute("id");
    elmLink.removeAttribute("src");
    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.
http://lists.adullact.net/pipermail/...er/005407.html

Cheers
Sankar
__________________
Cheers
Sankar
 
Old August 19th, 2008, 02:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

There is a javascript forum.. you should better be posting this there...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Content management Mike707 Dreamweaver (all versions) 1 September 1st, 2006 04:43 PM
Content Management Theory rit01 SQL Server ASP 0 November 30th, 2005 05:39 AM
i need content management console p2ptolu Classic ASP Components 1 February 24th, 2005 07:30 AM
Content management?? haggis82 Dreamweaver (all versions) 1 December 9th, 2004 03:11 AM
Content management sankar VB How-To 0 July 23rd, 2003 06:25 AM





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