141
philou
Re: How to use XoopsFormCheckBox
  • 2004/4/3 19:50

  • philou

  • Quite a regular

  • Posts: 384

  • Since: 2002/5/6 8


yes... I have edit the previous post to explain this.

I have the good field content with the echo



142
philou
Re: How to use XoopsFormCheckBox
  • 2004/4/3 19:46

  • philou

  • Quite a regular

  • Posts: 384

  • Since: 2002/5/6 8


the better...

$element_tray = new XoopsFormElementTray('Options');
$reqoption "select title from ".$xoopsDB->prefix("ann_options")." where pid=$fam_annonce order by title";
$result5 $xoopsDB->query($reqoption);
while (
$result_array $xoopsDB->fetchArray($result5)) 

 echo 
$result_array['title']." -- ";
 
$ener = new XoopsFormCheckBox ($result_array['title'], 'checkbox[]');
 
$ener->addOption(1_YES); 
 
$element_tray->addElement($ener);
}
$form->addElement($element_tray);
$form->display();


gives a line with 3 checkbox <= ok !
but the text isn't ok.
I obtain the following result :
Options tctc [] Oui tctc [] Oui tctc [] Oui

So I check with the
echo $result_array['title']." -- ";
and I have the good list
tata -- tbtb -- tctc



143
philou
Re: How to use XoopsFormCheckBox
  • 2004/4/3 19:31

  • philou

  • Quite a regular

  • Posts: 384

  • Since: 2002/5/6 8


It doesn't work...
Just the field 'option' appears as a simple label



144
philou
Re: How to use XoopsFormCheckBox
  • 2004/4/3 18:51

  • philou

  • Quite a regular

  • Posts: 384

  • Since: 2002/5/6 8


yes... and I don't understand why
I have 3 lines :

option : [] tctc
option : [] tctc
option : [] tctc

I want just have a 'classic' checkbox list as
I hope it's possible.... with a XoopsFormElementTray and have this :

option : []tata []tbtb []tctc



145
philou
Re: How to use XoopsFormCheckBox
  • 2004/4/3 13:36

  • philou

  • Quite a regular

  • Posts: 384

  • Since: 2002/5/6 8


oups.....
I have this now :
$reqoption "select title from ".$xoopsDB->prefix("ann_options")."where pid=$fam_annonce order by title";
$result5 $xoopsDB->query($reqoption);
while (
$result_array $xoopsDB->fetchArray($result5)) 
{
    
$ener = new XoopsFormCheckBox (_CLA_OPTION'checkbox[]'1);
    
$ener->addOption($result_array['title']);
    
$form->addElement($ener);
}
    
$form->display();


and the result is :
(I have 3 records tata, tbtb, tctc in the database)
3x lignes with "_CLA_OPTION" and a checkbox "tctc"
Strange isn't it ?




146
philou
Re: How to use XoopsFormCheckBox
  • 2004/4/3 11:01

  • philou

  • Quite a regular

  • Posts: 384

  • Since: 2002/5/6 8


when I do this... I have just the first checkbox...
that's my trouble



147
philou
Re: How to use XoopsFormCheckBox
  • 2004/4/3 10:35

  • philou

  • Quite a regular

  • Posts: 384

  • Since: 2002/5/6 8


it's ok thanks.. I understand how to use the "standard" XoopsFormCheckBox but I want to replace
....
while(list(
$title) = $xoopsDB->fetchRow($result5))
 { 
  
$option "option".$xm;
  echo 
"<input name='$option' type ='checkbox' value="$title">$title ";
  
$xm++;
 }
by the XoopsFormCheckBox. I don't know how to trnsform this...



148
philou
Re: No access for anonymous users
  • 2004/4/2 21:55

  • philou

  • Quite a regular

  • Posts: 384

  • Since: 2002/5/6 8


try to close your site. and in the preferences allow only members to access to your closed site



149
philou
Re: template repository would be good
  • 2004/4/2 21:53

  • philou

  • Quite a regular

  • Posts: 384

  • Since: 2002/5/6 8


in few days I hope.... some problems are not solved yet but all is good for me



150
philou
How to use XoopsFormCheckBox
  • 2004/4/2 21:30

  • philou

  • Quite a regular

  • Posts: 384

  • Since: 2002/5/6 8


Hi all,
I have a big problem with a small code.
I want to read a table and with using the XoopsFormCheckBox class generate some checkbox.
here is the code
$reqoption "select title from ".$xoopsDB->prefix("ann_options")." where pid=$fam_annonce order by title";
$result5 $xoopsDB->query($reqoption);
while (
$result_array $xoopsDB->fetchArray($result5))
              {
              
$ener = new XoopsFormCheckBox (_CLA_OPTION,$result_array[],$result_array[]);
              
$ener->addOptionArray($result_array);
                }

When I insert a
echo $result_array['title'];
in the loop I can see that the $result_array is ok.. not empty.
Can someone help me please ????

Thanks a lot




TopTop
« 1 ... 12 13 14 (15) 16 17 18 ... 23 »



Login

Who's Online

161 user(s) are online (75 user(s) are browsing Support Forums)


Members: 0


Guests: 161


more...

Donat-O-Meter

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

Latest GitHub Commits