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

[Solved] Inserting input of type hidden, but shows up in ie

1 Answer 85 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 20 May 2009, 07:48 PM
I have a custom control that insert a input of type hidden:
  Telerik.Web.UI.Editor.CommandList["InsertSubmissionForm"] = function(commandName, editor, args)
    {
       var myCallbackFunction = function(sender, args)
       {
          
                var myString +="<tr>" +
                        "<td align=\"center\" colspan=\"2\"><input class=\"AHbtnfield\" id=\"btnSubmitInitialForm\" onclick=\"return ValidateForm();\" type=\"submit\" value=\"Submit\" name=\"btnSubmitInitialForm\" /> <input id=\"hiddenSubmitInitialForm\" type=\"hidden\" value=\"hiddenSubmitInitialForm\" name=\"hiddenSubmitInitialForm\" /> </td>" +
                        "</tr>" +
                        "<tr>" +
                        "<td colspan=\"3\" charoff=\"2\">* = required</td>" +
                        "</tr>";
            
            
            
        
            editor.pasteHtml("<div id=\"submissionDiv\">" + myString + "</div>");
 
       }

It inserts fine but then the hidden field shows up in ie. If i click preview and then design it disapears then if i click html then design it comes back.

Anyway I can prevent this?

Thanks

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 22 May 2009, 11:13 AM
Hello Dan,

The content area of RadEditor is an editable IFRAME element which uses the Rich Text Editing engine of the browser. The IE creators have decided to make the <input type="hidden" /> hidden input elements visible in edit mode of the DIV / IFRAME elements so that the users can much easier edit them.

You can easy verify my words by testing the attached EditableIFRAME.html page where I have placed an editable <iframe> element for test. You will see that it is not possible to hide the hidden element in Edit mode even if you set inline style="display:none" attribute to it <input style="display:none"  type="hidden" />

Since this is a browser behavior, controlled entirely by the browser, we cannot override it with JavaScript or CSS.

Best 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
Dan
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or