Click here to Skip to main content
15,890,845 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi guys,

I am used iframe as textarea in ASP.net website,

but it do not work with firefox as i cann't enter the pointer inside it unless i write some text in it in page load

that is my javascript code where i must write some text like "any thing" with page load to work it with firefox

HTML
<script type="text/javascript">
                    
                    function populateIframe(iFrameId, text)
                    {
                        var iframe = document.getElementById(iFrameId);
                        var doc;

                        if (iframe.contentDocument)
                        {
                            doc = iframe.contentDocument;
                        }
                        else
                        {
                            doc = iframe.contentWindow.document;
                        }
                        
                        doc.write(text);
                    }
                    
                    var hdhiddenfieldValue = document.getElementById('<%=hdSaveHtml.ClientID %>').value;
                    
                    if(hdhiddenfieldValue=="")
                    {
                        hdhiddenfieldValue = "any thing";
                    }
                    
                    populateIframe('wysiwyg', hdhiddenfieldValue);
                </script>
Posted
Comments
Bryian Tan 15-Sep-12 23:24pm    
Can you do it with a space?
MrLonely_2 15-Sep-12 23:25pm    
I try this before but not work also
AmitGajjar 15-Sep-12 23:33pm    
But why you are using ifreame for text area? do you know the actual use of iframe ?
MrLonely_2 15-Sep-12 23:36pm    
because i use my custom editor which can deal nicely with iframe
AmitGajjar 15-Sep-12 23:39pm    
ok got it. In past i have also experienced the same with other WYSWYG. But as it was third party i can't do anything. Sorry i can't help you in this issue.

1 solution

use &nbsp; instead of space
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900