1
neda_barna
radio button
  • 2007/9/27 5:58

  • neda_barna

  • Just popping in

  • Posts: 63

  • Since: 2007/9/5 4


i want a 8 radiob button like this
excellent good bad ...
1-referee O O 0 0
and i want write in query if selected one of the option
please tell me how can make radio button like that
how can write query when selected
and type of field in mysql
thx

2
neda_barna
Re: radio button
  • 2007/9/27 6:35

  • neda_barna

  • Just popping in

  • Posts: 63

  • Since: 2007/9/5 4


$radio1_ele = new XoopsFormRadio(_REF_ISM_PAPER,'ism_paper',$ism_paper);

is it true or no

3
kaotik
Re: radio button
  • 2007/9/27 8:40

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


Example usage:
$xoopsForm->addElement(new XoopsFormButton('Button Caption''button_id''Button-Text''submit'));


You can find good reading at dev.xoops.org, you can also read about xoops form radio

4
neda_barna
Re: radio button
  • 2007/9/29 4:03

  • neda_barna

  • Just popping in

  • Posts: 63

  • Since: 2007/9/5 4


$ism_paper=$record->getVar'ism_paper' );
 
$radio1_ele = new XoopsFormRadio(_REF_ISM_PAPER,'ism_paper',$ism_paper,1);
       
$list = array ();
       
$list ["1"] = "test 1";
       
$list ["2"] = "test 2";
       
$list ["3"] = "test 3";
       
$list ["4"] = "test 4";
       
$list ["5"] = "test 5";
       
$radio1_ele->addOptionArray ($list);
       
$form->addElement$radio1_ele );

i think it is true
but i want have a function that make a radio like this
$radio1_ele->addOptionArray (function);
that i dont make a $list = array ();
$list ["1"] = "test 1";
$list ["2"] = "test 2";
$list ["3"] = "test 3";
$list ["4"] = "test 4";
$list ["5"] = "test 5";

i make this in function
please tell me what must i do

5
neda_barna
Re: radio button
  • 2007/9/29 9:54

  • neda_barna

  • Just popping in

  • Posts: 63

  • Since: 2007/9/5 4


this program become solved
but i have new problem
i want 4 radio button
that every radio button become in a side line
like this
O hello
O goodbye
O x
O y
and i want have 4 checkbox
under the radio x
what must i do
O hello
O good bye
O x
{3 chack box}
O y
please help me
i hurry up

6
kaotik
Re: radio button
  • 2007/9/29 10:02

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


I don't think you can accomplish this with XOOPS forms, since each form element is built by xoops; for ex:
$checked_value 1;
$checkbox1 = new XoopsFormCheckBox(, 'box1'$checked_value);
$checkbox1->addOption($checked_value_MD_MODNAME_CHECK_ME);
$form->addElement($checkbox1);

Maybe one of the XOOPS pro's while chime in here with a solution I'm unaware of.

7
neda_barna
Re: radio button
  • 2007/9/29 10:59

  • neda_barna

  • Just popping in

  • Posts: 63

  • Since: 2007/9/5 4


yes
you are right
i cant write this with XOOPS form
then write this with html
$vote1_content='


  

'._REF_QUEUE_ACCEPT1.'

    

  



  



    '._REF_QUEUE_ACCEPT2.'

    

  



  



    '_REF_QUEUE_REJECT.'

    

  



  



    check1

    

  



  



    check2

    

  



  



    check3

     

    

  



  



    check4

     

  



  



    '._REF_QUEUE_RETURN.'

    

  





 

 '
;

but i dont know how can use database
please tell me
what field of data base want
it want 4 field of table for radiobutton
or it want 1 field that type of this become enum(accept1,accept2,reject,return)
please help me

8
kaotik
Re: radio button
  • 2007/9/29 11:15

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


You could also solve your form this way. This would facilitate smarty loops:
<form id="form1" name="form1" method="post" action="">
<
table width="100%" border="1">
  <
tr>
    <
td width="14%"><label>
      <
input type="radio" name="radio" id="radio" value="radio" />
      
hellolabel>    td>
    <
td width="86%">&nbsp;td>
  tr>
  <
tr>
    <
td><label>
      <
input type="radio" name="radio2" id="radio2" value="radio2" />
      
goodbyelabel>td>
    <
td>&nbsp;td>
  tr>
  <
tr>
    <
td><label>
      <
input type="radio" name="radio3" id="radio3" value="radio3" />
      
xlabel>td>
    <
td><label>
      <
input type="checkbox" name="checkbox" id="checkbox" />
      
check 1<br />
      <
input type="checkbox" name="checkbox2" id="checkbox2" />
      
check 2<br />
      <
input type="checkbox" name="checkbox3" id="checkbox3" />
      
check 3<br />
    label>td>
  tr>
  <
tr>
    <
td><label>
      <
input type="radio" name="radio4" id="radio4" value="radio4" />
      
ylabel>td>
    <
td>&nbsp;td>
  tr>
table>
form>

I'm busy right now to give you guidance about database manipulation. You could however read through my tutorials, they teach you how to access and use tables, you then populate the html template using a smarty loop such as:
<{foreach item=brand from=$brands}>

9
neda_barna
Re: radio button
  • 2007/9/30 4:32

  • neda_barna

  • Just popping in

  • Posts: 63

  • Since: 2007/9/5 4


thx
when i use this
can i use addelement for show this
or i must use echo for show this

10
neda_barna
Re: radio button
  • 2007/9/30 8:20

  • neda_barna

  • Just popping in

  • Posts: 63

  • Since: 2007/9/5 4


i want write this with java script
that when clci on the radiobutton that have checkbox
show me 4 checkbox
but if i dont select another radio button dont show me checkbox

Login

Who's Online

259 user(s) are online (158 user(s) are browsing Support Forums)


Members: 0


Guests: 259


more...

Donat-O-Meter

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

Latest GitHub Commits