Problem with text fields after adding jsMath

  • Odyn

    Odyn - 2008-11-25

    I managed to install jsMath on a phpBB forum. It works fine, but unfortunately, since then, some users have trouble with writing. They can't normally start a new threads, write PMs, write messages on the shoutbox, becouse the cursor don't appear in the text boxes.
    Can jsMath may actually be the cause of the problem? And if so, what should I do to fix this error?
    I count on Your help.

    • Davide P. Cervone

      Does the problem occur only on pages with mathematics, or on ALL pages?  I don't see how jsMath could be the problem, except for one possibility.  In some browsers there is a clipping problem so that when complicated mathematics is used, links and text input areas directly below the mathematics on the page may be "covered over" by the mathematics above it, even though there is not visual indication of this.

      If this is what is happening for you, one solution is to change the z-index of the links and text areas.  For example

        a, input, textarea {z-index: 2; position:relative}

      should do it.   Of course, that's only of the overlap problem is really what is causing your troubles.


    • Odyn

      Odyn - 2008-12-02

      The problem appears on pages containing math, as well as on those without it.
      It turned out that the text boxes are locked only if someone is using Internet Explorer. Unfortunately, changing z-index doesn't help. I tried to add it in several ways, with different values but with no positive result.

      Any other ideas?

      • Davide P. Cervone

        The z-index fix would only help if you were only having trouble on pages that had math on it, ad then only if the controls that didn't work were directly below some mathematics.  It was a long shot, but the only thing I could think of.

        If you disable jsMath, does that make the problem go away?

        Thanks for pointing out that the issue is with IE only.  I'll look into whether I can reproduce such a problem locally.


    • Odyn

      Odyn - 2008-12-02

      What is the simplest way to disable jsMath? I do not want to uninstall the entire modification, becouse it'll take me too much time ...
      The problem concerns Although it is in Polish and without registration you won't be able to post or start a new thread, but as a guest, you can check shoutbox.

      • Davide P. Cervone

        OK, it turns out that it IS jsMath after all.  A change that I made in v3.6 to improve the ability to reposition the jsMath button (usually in the lower-right-hand corner) in IE is causing the problem.  This is due to several bugs in IE.  The one I was trying to work around was the lack of CSS support for position:fixed, so I used a window-sized transparent absolutely-positioned DIV to which the fixed-positioned elements could be attached, and then move that DIV as the window scrolls.  This works very nicely, except for one thing:  IE has a bug in deciding what element should get the focus when a text input area is below the transparent DIV:  if the text input area is rendered as a native Window widget (the default unless certain CSS styles are applied) then it is incorrectly considered to be transparent as well, and so the transparent DIV gets the focus rather than the input area.  In some cases, however, IE will render the input area using internal routines (e.g., of the background is set to an empty string), and then the focus is handled properly.  I considered adding CSS that would force text input areas to have such backgrounds, but there were two problems:  first, doing so changes the rendering the borders, and I didn't want to specify additional CSS to compensate (that starts to make things pretty fragile); and second, yet another bug in IE prevents it from processing the CSS attribute selectors that would have been necessary to separate the text input tags from other input tags.  So that ruled out that fix.

        The only way I can come up with is to not have the transparent DIV that is used for the floating button.  As long as it covers the window, IE will mishandle the text input areas.  So instead of making it as tall as the window, I can make it 0-height and positioned at the bottom of the window so that the button and message windows will still be positioned correctly, but the DIV won't cover the whole page.  That reduces its value, as you can't change the button to being attached to the top of the window (for example), but I guess that's better than not being able to select input areas properly.

        I will add this to the next release of jsMath.  In the meantime, do the following:  Make a file called "local.js" in your jsMath/local directory, and enter the following code in it:

        __jsMath = {
        ____Controls: {
        ______MoveButton: function () { = document.body.scrollLeft + 'px'; = document.body.scrollTop + document.body.clientHeight + 'px'; = document.body.clientWidth + 'px';

        (the underscores are just for formatting on this page; you will need to convert them to spaces.)

        Then add

        <script src="/jsMath/local/local.js"></script>

        just BEFORE the tag that loads jsMath.js itself.  I think that should take care of the problem for you.


    • Odyn

      Odyn - 2008-12-18

      I didn't get an e-mail with information about new response, that's why I saw your message so late... 
      I have performed your tips, and now everything works as it should :)
      Thank you for your time and help.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks