IFRAME Problem in firefox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • syedfasih
    New Member
    • Feb 2007
    • 10

    IFRAME Problem in firefox

    I have created a text area using IFRAME. The problem is that it is working only in Internet Explorer not in Mozilla Firefox. Please help me regarding this problem. IS there any special command or tag which runs on both IE and firefox? Thanks in advance.... Code is below:
    <HTML>
    <Head>
    <Title>Simple Demo of HTML Area </Title>
    <Script Language="JavaS cript">
    function doBold()
    {
    frameEdit.docum ent.execCommand ('bold', false, null);
    }
    function doItalic()
    {
    frameEdit.docum ent.execCommand ('italic', false, null);
    }
    function Heading()
    {
    frameEdit.docum ent.execCommand ('FormatBlock', false,'<H1>');
    }
    </Script>
    </Head>
    <Body onLoad="frameEd it.document.des ignMode='on';">
    <form id="frmEdit">
    <IFRAME id="frameEdit" style="width:60 0px; height:300px" align=center>
    </IFRAME>
    <br>
    <P align=center>
    <Input type="Button" value="Bold" onClick="doBold ()">
    <Input type="Button" value="Italic" onClick="doItal ic()">
    <Input type="Button" value="H1" onClick="Headin g()">
    </P>


    </form>
    </Body>
    </HTML>
  • AricC
    Recognized Expert Top Contributor
    • Oct 2006
    • 1885

    #2
    This is the HTML forum is this a Javascript problem?

    Comment

    • syedfasih
      New Member
      • Feb 2007
      • 10

      #3
      Originally posted by AricC
      This is the HTML forum is this a Javascript problem?
      Well Ignore javascript and just see the HTML Body after removing the buttons and their functuions

      Comment

      • AricC
        Recognized Expert Top Contributor
        • Oct 2006
        • 1885

        #4
        Originally posted by syedfasih
        Well Ignore javascript and just see the HTML Body after removing the buttons and their functuions
        I don't see anything wrong with the HTML except your mixing XHTML with HTML you should stick with one or the other. I'm also not really clear what the problem is.

        Aric

        Comment

        • iam_clint
          Recognized Expert Top Contributor
          • Jul 2006
          • 1207

          #5
          your iframe has no source?

          Comment

          • AricC
            Recognized Expert Top Contributor
            • Oct 2006
            • 1885

            #6
            Originally posted by iam_clint
            your iframe has no source?
            Without a source it just shows as a big empty box. Please tell us what's not working I think we are a little lost here.

            Aric

            Comment

            • drhowarddrfine
              Recognized Expert Expert
              • Sep 2006
              • 7434

              #7
              Is execCommand a Microsoft only thing?

              Comment

              • syedfasih
                New Member
                • Feb 2007
                • 10

                #8
                Copy and paste the code below and save the file as .htm or .html. open the file in Internet Explorer and try to type something in the box, It will allow you to type characters in it. When you open it in firefox it will disable the iframe and prevents you to type anything...

                Actually I am creating an editor for a Forum.

                <HTML>
                <Head>
                <Title>Simple Demo of HTML Area </Title>
                </Head>

                <Body onLoad="frameEd it.document.des ignMode='on';">
                <form id="frmEdit">
                <IFRAME id="frameEdit" style="width:60 0px; height:300px" align=center>
                </IFRAME>

                </form>
                </Body>
                </HTML>


                Thanks to you all

                Comment

                • drhowarddrfine
                  Recognized Expert Expert
                  • Sep 2006
                  • 7434

                  #9
                  One problem is onload needs to be in lower case. But this continues to look like a javascript problem and not html/css so I am moving it to that forum.

                  Comment

                  • acoder
                    Recognized Expert MVP
                    • Nov 2006
                    • 16032

                    #10
                    Originally posted by drhowarddrfine
                    Is execCommand a Microsoft only thing?
                    Yes that's right.

                    Comment

                    • acoder
                      Recognized Expert MVP
                      • Nov 2006
                      • 16032

                      #11
                      Syed fasih, see this link - that should solve your problem.

                      Comment

                      • syedfasih
                        New Member
                        • Feb 2007
                        • 10

                        #12
                        Originally posted by acoder
                        Syed fasih, see this link - that should solve your problem.

                        Thank You So much... My problem has been solved....

                        Comment

                        • acoder
                          Recognized Expert MVP
                          • Nov 2006
                          • 16032

                          #13
                          No problem, you're welcome. Glad to see that it solved your problem.

                          Comment

                          Working...