PEAR::HTML_QuickForm select element

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

    PEAR::HTML_QuickForm select element

    I am trying to get a default value set for a "Select" element, like this:

    $f = new HTML_QuickForm( "request", "post", "", "_self", NULL,TRUE);
    $f_priority = array ("Very low","Low","Nor mal","High","Ve ry High");
    $priority_eleme nt =& $f->addElement("se lect", "request_priori ty",
    "Priority:" , $f_priority);
    $priority_eleme nt->setSelected("2 ");
    ....

    But the html which is generated from this looks like this:

    ....
    <option value="1">Low</option>
    <option value="2" selected="selec ted">Normal</option>
    <option value="3">High</option
    ....

    To my understanding, it should only say "selected", not "selected="sele cted"

    Is there some workaround, am I doing something wrong, or does one need
    to hack QuickForm for this?

    /Marcin
  • Julien CROUZET aka c2c

    #2
    Re: PEAR::HTML_Quic kForm select element

    Marcin Dobrucki <Marcin.Dobruck i@TAKETHISAWAY. nokia.com> pipotte et a dit :
    [color=blue]
    > I am trying to get a default value set for a "Select" element, like this:
    >
    > $f = new HTML_QuickForm( "request", "post", "", "_self", NULL,TRUE);
    > $f_priority = array ("Very low","Low","Nor mal","High","Ve ry High");
    > $priority_eleme nt =& $f->addElement("se lect", "request_priori ty",
    > "Priority:" , $f_priority);
    > $priority_eleme nt->setSelected("2 ");
    > ...
    >
    > But the html which is generated from this looks like this:
    >
    > ...
    > <option value="1">Low</option>
    > <option value="2" selected="selec ted">Normal</option>
    > <option value="3">High</option
    > ...
    >
    > To my understanding, it should only say "selected", not "selected="sele cted"
    >
    > Is there some workaround, am I doing something wrong, or does one need
    > to hack QuickForm for this?
    >[/color]

    The valid XHTML syntax is <option selected="selec ted"

    Sorry! We can't seem to find the resource you're looking for


    --
    Julien CROUZET aka c2c Promo 2007[color=blue][color=green]
    >> Suivi: Une operation de maintenance va necessiter d'interrompre gate-nat
    >> Suivi: momentanement. Duree de l'operatin evaluee a 15 minutes.[/color]
    > Suivi: Intervention terminee. Duree reelle de l'intervention: 30 minutes.[/color]
    badi

    Comment

    • Marcin Dobrucki

      #3
      Re: PEAR::HTML_Quic kForm select element

      Julien CROUZET aka c2c wrote:
      [color=blue]
      >
      > The valid XHTML syntax is <option selected="selec ted"
      >
      > http://www.w3schools.com/xhtml/xhtml_syntax.asp[/color]

      Buggers, Mozilla 1.6 doesn't render it then. :/

      /Marcin

      Comment

      • Alvaro G Vicario

        #4
        Re: PEAR::HTML_Quic kForm select element

        *** Marcin Dobrucki wrote/escribió (Wed, 09 Jun 2004 08:52:40 GMT):[color=blue]
        > Buggers, Mozilla 1.6 doesn't render it then. :/[/color]

        It does render it!

        --
        --
        -- Álvaro G. Vicario - Burgos, Spain
        --

        Comment

        • Marcin Dobrucki

          #5
          Re: PEAR::HTML_Quic kForm select element

          Alvaro G Vicario wrote:[color=blue]
          > *** Marcin Dobrucki wrote/escribió (Wed, 09 Jun 2004 08:52:40 GMT):
          >[color=green]
          >> Buggers, Mozilla 1.6 doesn't render it then. :/[/color]
          >
          > It does render it![/color]

          no it doesn't. In the example I posted, the rendered default
          selected option is "very low" when it should be "normal".

          /Marcin

          Comment

          • Marcin Dobrucki

            #6
            Re: PEAR::HTML_Quic kForm select element

            Alvaro G Vicario wrote:[color=blue]
            > *** Marcin Dobrucki wrote/escribió (Wed, 09 Jun 2004 08:52:40 GMT):
            >[color=green]
            >> Buggers, Mozilla 1.6 doesn't render it then. :/[/color]
            >
            > It does render it![/color]

            Indeed. My browser was stuck in nevernever land, and after it reset
            it seems to have worked.

            /Marcin

            Comment

            Working...