Using the element object from javascript

Last post 12-13-2006, 7:51 AM by lalala. 4 replies.
Sort Posts: Previous Next
  •  11-28-2006, 11:08 AM 24628

    Using the element object from javascript

    Hi,

    I've created a toolbar button that inserts a DIV with de next html:

    <div style="WIDTH: 75px; HEIGHT: 23px; mytag: itsvalue">...</div>

    Then I've created my own dialog, tag_miowndialog.ascx, that uses the next javascript code to get and set that value:

        function SyncToView()
        {
            mytextbox["value"] = element["style"]["mytag"];
            ...
        }

        function SyncTo(element)
        {
            element["style"]["mytag"] = mytextbox["value"];
            ...
        }

    That works well, but I would like to store my information outside of the style tag, like this:

      <div style="..." mytag="prop: value">...</div>

    Doing that, I've not been able to get the information. What javascript code do I need to get it?


    Thanks and congratulations for your great editor!






    Filed under:
  •  11-30-2006, 12:43 PM 24724 in reply to 24628

    Re: Using the element object from javascript

    Is this the support I'm getting for $499?
  •  11-30-2006, 1:17 PM 24727 in reply to 24628

    Re: Using the element object from javascript

    Sorry for the late response.
     
    >>That works well, but I would like to store my information outside of the style tag, like this:

      <div style="..." mytag="prop: value">...</div>
     
    It's possible.
     
    Please try:
     
    element.setAttribute("mytag","my value");
     
    Keep me posted
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  12-08-2006, 5:49 AM 24985 in reply to 24727

    Re: Using the element object from javascript

    This is just what I needed.

    Thanks Adam.


    Another question:

    I'm using the DIV tag to put in the editor objects with my own information (last question). I'm using the DIV tag because I want it's behaviour for my objects. I want to be able to move and resize it.

    When the user selects Properties, the dialog shows the DIV properties (DIV, General, Style Builder) and another one that I've added.

    There is any way to create a personal tag, with the same behaviour of DIV, in order that when properties is selected only my dialog is shown?

    Thanks in advance.

  •  12-13-2006, 7:51 AM 25093 in reply to 24985

    Re: Using the element object from javascript

    Any idea? Or just this can't be done?

    Thanks

View as RSS news feed in XML