1
adxcreation
SURVEY MODULE - add extra select field in persondata.php
  • 2006/12/13 23:50

  • adxcreation

  • Just popping in

  • Posts: 2

  • Since: 2006/12/13


Hi,

I have installed the wonderfull survey module 0.6 beta on my site and succeded in creating another "mixed" element such as the Person Data Input Fields.
Instead of displaying only textfield, I would like to add select field.

adding textfiled is done using something like this :

$this->addElement(new XoopsFormText(_MA_SV_LOCAL, 'localisation', $GLOBALS['xoopsModuleConfig']['t_width'], $GLOBALS['xoopsModuleConfig']['t_max']), true);


Now, I cannot find out how I might replace XoopsFormText with XoopsFormSelect and add the options (data) to the select field.

Can Anyone help me?

Maybe Mithrandir...

Thanks to all in advance !!!!!!!!

Laurent

2
chippyash
Re: SURVEY MODULE - add extra select field in persondata.php
  • 2006/12/14 7:45

  • chippyash

  • Friend of XOOPS

  • Posts: 501

  • Since: 2004/1/29


$ele = new XoopsFormSelect($caption, $name, $value=null, $size=1, $multiple=false);

$ele->addOption($value,$name);
/* or */
$options = array(0=>'Opt1',1=>'opt2');
$ele->addOptionArray($options);

$this->addElement($ele);
unset($ele); //only need this if you are going to reuse $ele

TIP
Although XOOPS is not well documented, you do have access to the source code. Get yourself familiar with the 'class' directory and its contents, in your XOOPS installation. For forms, you'll find all the declaration in the class/xoopsform directory

3
adxcreation
Re: SURVEY MODULE - add extra select field in persondata.php
  • 2006/12/17 0:16

  • adxcreation

  • Just popping in

  • Posts: 2

  • Since: 2006/12/13


thanks akitson...

I knew UK Guys were the best...
I succeded in adding the select form but absolutely not in adding the options to it... Even using xoopsform classes... I also tried to add a new XOOPS list and using it (easier I though) no result... Maybe is the code used for survey not using standard XOOPS form classes...

Anyway, I will try even more tomorow....

Thanks once again !

Login

Who's Online

519 user(s) are online (56 user(s) are browsing Support Forums)


Members: 0


Guests: 519


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Sep 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits