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
www.kaotik.biz

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.
www.kaotik.biz

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='<form name="form2" method="post" action="comment.php">


  <p>'
._REF_QUEUE_ACCEPT1.'

    <input name="radiobutton" type="radio" value="ACCEPT1" >

  </p>

  <p>

    '
._REF_QUEUE_ACCEPT2.'

    <input name="radiobutton" type="radio" value="ACCEPT@">

  </p>

  <p>

    '
_REF_QUEUE_REJECT.'

    <input name="radiobutton" type="radio" value="REJECT">

  </p>

  <p>

    check1

    <input type="checkbox" name="checkbox" value="checkbox">

  </p>

  <p>

    check2

    <input type="checkbox" name="checkbox2" value="checkbox">

  </p>

  <p>

    check3

    <input type="checkbox" name="checkbox3" value="checkbox"> 

    <input type="text" name="textfield">

  </p>

  <p>

    check4

    <input type="checkbox" name="checkbox4" value="checkbox"> 

  </p>

  <p>

    '
._REF_QUEUE_RETURN.'

    <input name="radiobutton" type="radio" value="RETURN">

  </p>

</form>

<p>&nbsp;</p> '
;

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" />
      
hello</label>    </td>
    <
td width="86%">&nbsp;</td>
  </
tr>
  <
tr>
    <
td><label>
      <
input type="radio" name="radio2" id="radio2" value="radio2" />
      
goodbye</label></td>
    <
td>&nbsp;</td>
  </
tr>
  <
tr>
    <
td><label>
      <
input type="radio" name="radio3" id="radio3" value="radio3" />
      
x</label></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" />
      
y</label></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}>
www.kaotik.biz

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

193 user(s) are online (122 user(s) are browsing Support Forums)


Members: 0


Guests: 193


more...

Donat-O-Meter

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

Latest GitHub Commits