Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
$_actions for jmCheckBox
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 05/09/09 00:27 
im kind of unclear on the $_actions available for the jmCheckBox function.
http://www.jamroom.net/Function_jmCheckBox

is it possible to have
X option 1
X option 2 ___ additional text input 1 _____ additional text input 2

i have tried a few things to get it going like this

Code
   $_actions = array('this is one', 'this is two');
   jmCheckBox('Type','type','option 1',false,$_actions);


but this produces 2 buttons, each with the letter 'T' on it. I want to produce another check box and 2 text input fields.


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
SteveX
Ultrabubble


Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble

Posted: 05/09/09 02:28 
I thought that you could use the jrFormElementCell function to make a checkbox group:
http://www.jamroom.net/Function_jrFormElementCell

Although it isn't in the docs you can pass in a name for the group, but I can't find how to make a label for each checkbox.


Code
$_chk[0]['name']  = 'aaa';
$_chk[0]['type']  = 'checkbox';
$_chk[0]['value'] = 'choice1';

$_chk[1]['type']  = 'checkbox';
$_chk[1]['name']  = 'aaa';
$_chk[1]['value'] = 'choice2';

jrFormElementCell('My Checkbox Group Title',$_chk);


But unless I am missing something (usually the case) it isn't of any use, as that just outputs class="checkbox" twice on each checkbox, no value and no label;


Code
<tr>
    <td width="30%" class="left">
      My Checkbox Group Title
          </td>
    <td width="70%" class="right" nowrap="nowrap">
   
           
                   
              <input type="checkbox" class="checkbox"  name="aaa" class="checkbox">
         
           
                   
              <input type="checkbox" class="checkbox"  name="aaa" class="checkbox">
              </td>
  </tr>



_________________
Kulshi Mezian!

"Stranger from another planet, welcome to our hole. Just strap on your guitar and we'll play some rock and roll"

Ultrabubble create things.
Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 05/09/09 02:49 
Smile am i reading that right...???? "here is something that doesnt work, go try it for yourself and see that it doesnt work."

ill try it out. Thanks Steve. Very Happy


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
SteveX
Ultrabubble


Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble

Posted: 05/09/09 03:06 
No, don't try it! I was just posting it here to save you trying it which I thought you might as the docs seem to say that you can create a checkbox group with it! Sorry if you did.

The best way that I can see for now is to use jmLinkCell:
http://www.jamroom.net/Function_jmLinkCell


Code
 $group = '<input type="checkbox" name="color" value="red">
Red<br>

<input type="checkbox" name="color" value="yellow">
Yellow<br>

<input type="checkbox" name="color" value="blue">
Blue<br>

<input type="checkbox" name="color" value="orange">
Orange<br>

<input type="checkbox" name="color" value="green">
Green<br>

<input type="checkbox" name="color" value="purple">
Purple<br> ';
 jmLinkCell("checkbox group title", $group);



_________________
Kulshi Mezian!

"Stranger from another planet, welcome to our hole. Just strap on your guitar and we'll play some rock and roll"

Ultrabubble create things.
Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 05/09/09 03:15 
nope, despite your best advice i tried it. I tried it, im hooked now and its your fault. Smile

I did get it figured out though.

this worked.

Code

    $_btn[1]['type']  = 'checkbox';
    $_btn[1]['name']  = 'choice1';
    $_btn[2]['type']  = 'text';
    $_btn[2]['value'] = 'Choise One,<br>';   
    $_btn[3]['type']  = 'checkbox';
    $_btn[3]['name']  = 'choice2';
    $_btn[4]['type']  = 'text';
    $_btn[4]['value'] = 'Choice Two ';     
    $_btn[5]['type']  = 'input';
    $_btn[5]['name']  = 'input_box_name1';
     
    $_btn[6]['type']  = 'text';
    $_btn[6]['value']  = ' some text here';
    $_btn[7]['type']  = 'input';
    $_btn[7]['name']  = 'input_box_name2';       
    $_btn[8]['type']  = 'text';
    $_btn[8]['value']  = ' more text here. ';
         
    jrFormElementCell('The Cell Title',$_btn);


Thanks mate!! Very Happy


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
SteveX
Ultrabubble


Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble

Posted: 05/09/09 03:56 
Interesting way to use that, but I still see the class="thing" appearing twice for each checkbox, I'm not sure why that would be.

Sorry to hear that you are hooked, but I can't take the blame for that. I have a Jamroom Form Functions habit myself, it's been on my back since my first taste of a jmYesNo. And they said that Smarty didn't lead on to stronger things Wink


_________________
Kulshi Mezian!

"Stranger from another planet, welcome to our hole. Just strap on your guitar and we'll play some rock and roll"

Ultrabubble create things.
Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 05/10/09 18:10 

stevex:
...I still see the class="thing" appearing twice for each checkbox, I'm not sure why that would be.

im not getting the duplicates. It all looks good.

could it be because you have both a name and a value for a single element.

when i use the type as 'text' then it gets a value, but not a name. and when the type is 'checkbox' it gets a name but not a value.


Code
    $_btn[1]['type']  = 'checkbox';
    $_btn[1]['name']  = 'choice1';
    $_btn[2]['type']  = 'text';
    $_btn[2]['value'] = 'Choice One,<br>';   


seams to work.


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Developers

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.