Is there a way to populate or modify items of the dropdown from javascript?

Last post 07-13-2007, 12:05 PM by Adam. 2 replies.
Sort Posts: Previous Next
  •  07-12-2007, 5:11 PM 31513

    Is there a way to populate or modify items of the dropdown from javascript?

    Hi All,

    Is there a way to populate or modify items of the dropdown from javascript?

    Thanks for your help

    Filed under: ,
  •  07-12-2007, 7:01 PM 31514 in reply to 31513

    Re: Is there a way to populate or modify items of the dropdown from javascript?


    Note:
    I want to add items to a CuteEditor.RichDropDownList, using javascript code
    I don't want to use the codehind(c#)

    Is there a way to do that?

    Thanks

  •  07-13-2007, 12:05 PM 31527 in reply to 31514

    Re: Is there a way to populate or modify items of the dropdown from javascript?

    There is no javaScript API that allows you do this directly.
     
    However if you are familar with JavaScript, you can populate the RichDropDownList using javaScript easily.
     
    Here is the html code of FormatBlock dropdown. 
     
    To add your own span item, you need to follow the steps below.
     
    1. Get FormatBlock dropdown by ID.
     
    2. Create your span item and append it to FormatBlock dropdown object (using appendChild method).
     
    3. Set attribute to your span item (using setAttibute method).

    <span class="CuteEditorDropDown" id="CE_Editor1_IDformatblock" Command="FormatBlock" onchange="CuteEditor_DropDownCommand(this,'FormatBlock')" RichHideFirstItem="true" RenderItemBorder="true" _IsRichDropDown="True" style="display:inline-block;width:70px;height:20px;">

    <span val="" selected="True" html="Paragraph" txt="Paragraph"></span>

    <span val="&lt;P>" html="Normal" txt="Normal"></span>
    <span val="&lt;H1>" html="&lt;b style='font-size:24pt'>Heading 1&lt;/b>" txt="Heading 1"></span>
    <span val="&lt;H2>" html="&lt;b style='font-size:18pt'>Heading 2&lt;/b>" txt="Heading 2"></span>
    <span val="&lt;H3>" html="&lt;b style='font-size:15pt'>Heading 3&lt;/b>" txt="Heading 3"></span>
    <span val="&lt;H4>" html="&lt;b style='font-size:12pt'>Heading 4&lt;/b>" txt="Heading 4"></span>
    <span val="&lt;H5>" html="&lt;b style='font-size:9pt'>Heading 5&lt;/b>" txt="Heading 5"></span>
    <span val="&lt;H6>" html="&lt;b style='font-size:7pt'>Heading 6&lt;/b>" txt="Heading 6"></span>
    <span val="&lt;Address>" html="Address" txt="Address"></span>
    <span val="&lt;MENU>" html="Menu List" txt="Menu List"></span>
    <span val="&lt;PRE>" html="Formatted" txt="Formatted"></span>
    <span val="&lt;DT>" html="Definition Term" txt="Definition Term"></span>

    </span>


    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

View as RSS news feed in XML