1
risto
XoopsFormSelect setting selected
  • 2004/10/13 12:05

  • risto

  • Not too shy to talk

  • Posts: 159

  • Since: 2003/4/16


when looping threw options for a select box like this;
Lets say I have three arrays.
$values[$i]
$options[$i]
$selected[$i] => 0 not selected 1 selected
le="color: #000000"><?php $ProductSupplyer_select->addOption($values[$i],$options[$i]);


How doo I set the selected value?
le="color: #000000"><?php if ($selected[$i]==1){ $selected= "selected" } $ProductSupplyer_select->addOption($values[$i],$options[$i],$selected); $selected="";


can somone help me out here?

2
Dave_L
Re: XoopsFormSelect setting selected
  • 2004/10/13 12:39

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


XoopsFormSelect::addOption only has two parameters.

The third parameter ($value) of XoopsFormSelect::XoopsFormSelect specifies the selected value(s).

There's also a method XoopsFormSelect::setValue that appears to do this too, but I haven't used that myself.

3
risto
Re: XoopsFormSelect setting selected
  • 2004/10/13 12:47

  • risto

  • Not too shy to talk

  • Posts: 159

  • Since: 2003/4/16


where can I find documentation on these types of things?

4
Dave_L
Re: XoopsFormSelect setting selected
  • 2004/10/13 12:54

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


I don't know if there's any external documentation on that.

I look at the source files (class/xoopsform/formselect.php in this case), as well as using other core or modules files as examples of using the classes.

5
theCat
Re:XoopsFormSelect setting selected
  • 2004/10/13 13:06

  • theCat

  • Just popping in

  • Posts: 77

  • Since: 2004/2/2 2


You can find a non official documentation (but only in french) here

6
Mithrandir
Re:XoopsFormSelect setting selected

for the technical reader:
XOOPS API Docs on XoopsForm elements

And a bit more userfriendly, but still technical:
XoopsForm explained on dev.xoops.org WIKI

7
JasonMR
Re:XoopsFormSelect setting selected
  • 2004/10/13 13:20

  • JasonMR

  • Just can't stay away

  • Posts: 655

  • Since: 2004/6/21


Merci Cat, for that French Doc link, very nice

Although, my French ain't what it used to be, so I am in need of googles assistance. Never the less a great resource.

Is someone working on English translations of some of the great French Documentation work? I also saw some valuable stuff over at http://xoops-modules.com.

8
risto
Re:XoopsFormSelect setting selected
  • 2004/10/13 13:22

  • risto

  • Not too shy to talk

  • Posts: 159

  • Since: 2003/4/16


ok thanks.

I also found this! https://xoops.org/misc/api/

LOL

9
theCat
Re:XoopsFormSelect setting selected
  • 2004/10/13 13:43

  • theCat

  • Just popping in

  • Posts: 77

  • Since: 2004/2/2 2


Quote:
I also saw some valuable stuff over at http://xoops-modules.com.

It is our first documentation, but it is not entirely right. We want to write again and transfert it on http://www.xoops-doc.org for the French community which does not speak English.

10
JasonMR
Re:XoopsFormSelect setting selected
  • 2004/10/14 1:00

  • JasonMR

  • Just can't stay away

  • Posts: 655

  • Since: 2004/6/21


I love the work of the French Community.

I signed up over at http://Xoops-Modules.com, and use it as a motivator, to reinstall/activate my French skillz


Are you in contact with the english speaking doc team? I hope some of your contributions will soon also be available in English.

Thanks for your great work! Keep it up!