Selected item of selection box not visible during display

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rukkie

    Selected item of selection box not visible during display

    I've made a webform in which some selection boxes are incorporated.
    Once the form is submitted the user can display the form again and all
    the options selected are highlighted (via the "selected" keyword). The
    only thing what bothers me is that sometimes the selected option is not
    visible ; one has to scroll down the selection box to see the
    highlighted item. Is there anyone who has experienced the same and
    found a solution for this "small" problem.
    Thanks in advance !!

  • friglob

    #2
    Re: Selected item of selection box not visible during display

    rukkie wrote:
    I've made a webform in which some selection boxes are incorporated.
    Once the form is submitted the user can display the form again and all
    the options selected are highlighted (via the "selected" keyword). The
    only thing what bothers me is that sometimes the selected option is not
    visible ; one has to scroll down the selection box to see the
    highlighted item. Is there anyone who has experienced the same and
    found a solution for this "small" problem.
    Thanks in advance !!
    >
    here is one possible solution (if i understood right):

    lets say your form action is validate_form.p hp
    make it validate_form.p hp#begin
    and add <a name="begin"to the line that should appear on the very top of the screen after submitting

    Comment

    • Erwin Moller

      #3
      Re: Selected item of selection box not visible during display

      rukkie wrote:
      I've made a webform in which some selection boxes are incorporated.
      Once the form is submitted the user can display the form again and all
      the options selected are highlighted (via the "selected" keyword). The
      only thing what bothers me is that sometimes the selected option is not
      visible ; one has to scroll down the selection box to see the
      highlighted item. Is there anyone who has experienced the same and
      found a solution for this "small" problem.
      Thanks in advance !!
      Hi rukkie,

      Well, that is not excactly a browser SHOULD do.
      The browser is just displaying the whole multiple selectbox.

      But if memory serves me well, I solved that 'problem' once via JavaScript.
      By adding some javascript that unselected, then reselected the first option.

      The browsers I tested it on all jumped to the first selected index after
      that. Of course that will only work if JavaScript is enabled.

      But this has nothing to do with PHP.
      PHP only generated the HTML your browser is displaying.
      With these kind of questions you might get luckier in a HTML newgroup, or
      JavaScript newsgroup.

      Good luck.

      Regards,
      Erwin Moller

      Comment

      • Colin Fine

        #4
        Re: Selected item of selection box not visible during display

        Erwin Moller wrote:
        rukkie wrote:
        >
        >I've made a webform in which some selection boxes are incorporated.
        >Once the form is submitted the user can display the form again and all
        >the options selected are highlighted (via the "selected" keyword). The
        >only thing what bothers me is that sometimes the selected option is not
        >visible ; one has to scroll down the selection box to see the
        >highlighted item. Is there anyone who has experienced the same and
        >found a solution for this "small" problem.
        >Thanks in advance !!
        >
        Hi rukkie,
        >
        Well, that is not excactly a browser SHOULD do.
        The browser is just displaying the whole multiple selectbox.
        >
        But if memory serves me well, I solved that 'problem' once via JavaScript.
        By adding some javascript that unselected, then reselected the first option.
        >
        The browsers I tested it on all jumped to the first selected index after
        that. Of course that will only work if JavaScript is enabled.
        >
        But this has nothing to do with PHP.
        PHP only generated the HTML your browser is displaying.
        With these kind of questions you might get luckier in a HTML newgroup, or
        JavaScript newsgroup.
        >
        Good luck.
        >
        Regards,
        Erwin Moller
        I don't believe there is a specification anywhere of exactly what user
        agents should display in this case. It is annoying, but sometimes, on
        some browsers, the highlighted entry is not in the visible part of popup.
        I think the Javascript solution is the only one that has a chance of
        working - but even then, the behaviour of the browser is not defined.

        Colin

        Comment

        Working...