This is a migrated thread and some comments may be shown as answers.

[Solved] Custom DropDownList ItemValue different from what is set on the server

1 Answer 85 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 14 Aug 2009, 05:09 PM
I'm adding values to a custom DropDownList on the server w/ the following format:

<img fieldName=\"{0}\" tableName=\"{1}\" alt=\"[{2}]\" style=\"font-weight: bold\" />

When the user selects one of the values in the DropDownList, the OnClientCommandExecuting pastes the value of the selectedItem
as follows:



function templateEditorOnClientCommandExecuting(sender, eventArgs) 
            { 
                var name = eventArgs.get_name(); 
                var val = eventArgs.get_value(); 
                                 
                if(name == "Fields"
                { 
                    if(val != null && val != ''
                    { 
                        sender.pasteHtml(val); 
                    } 
                    else 
                    { 
                        alert('Select a Template Type first'); 
                    } 
                     
                    eventArgs.set_cancel(true); 
                } 
            }      

The pasted value is as follows:

<img style=\"font-weight: bold;\" alt=\"[Address]\" tablename=\"Organization\" fieldname=\"MailAddress1\" />

Why is the order of the attributes of my img element on the client different than what I explicitly set on the server?  I'm trying to write a regular expression to do a replace of the img tag when the form is submitted, but I'm not able to due to the issue described above.


1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 17 Aug 2009, 02:45 PM
Hello Eric,

The content area of RadEditor is editable IFRAME which uses the underlining Rich Text Editing engine of the browser where it operates. The observed behavior is browser behavior and it is the browser that rearranges the attributes order in the HTML tags. You can reproduce the same behavior in the attached HTML page having an editable IFRAME elements in it as well as in our competitors' editors.

Unfortunately, it is not possible to control this browser behavior with code and override it.

Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
Eric
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or