Jamroom Logo
Newsletter
Member Spotlight
270247
GigMemories
"This Jamroom website is different as its 'Gig' based as opposed to 'Artist' based. Changing the Jamroom language files to reflect this was pretty straightforward, but it was Jamroom's inherent flexibility and its create custom form fields and buttons feature that proved invaluable in the development of this site."
Follow Jamroom on Twitter!


jmButton Function Index jmChoose
jmCheckBox

The jmCheckBox function is used to create a checkbox form element in a Jamroom Control Panel form.

form.tpl element name: form_checkbox

  • return: Returns True
bool jmCheckBox (string $text, string $name, string $help, [bool $checked = false], [array $_actions = false])
  • string $text: Title for form field - i.e. the string to the left in the Control Panel
  • string $name: Form field "name" value
  • string $help: Help Text for the form field
  • bool $checked: Set to true if checkbox should be checked when the form loads
  • array $_actions: Additional form elements ("actions") that will appear below the input form field
 Comments
bigguy, 05/21/09 08:52:01:

The $_actions array can be used to add a row of "buttons" below the checkbox, that when clicked will execute an "onclick" action. So for example, if you want to show 2 buttons below a checkbox, you could do something like:



$_actions = array();

$_actions[0]['value'] = 'Button Text #1';

$_actions[0]['onclick'] = "alert('You Clicked Button #1!');"

$_actions[1]['value'] = "Button Text #2";

$_actions[1]['onclick'] = "alert('You Clicked Button #2!');"



jmCheckBox('Sample Actions','form_name','Check this box to set the form_name $_REQUEST ($_post) variable to _on_ when submitted',true,$_actions);



Note that you can have as many different values in your $_actions array as you want (i.e. you do not only have to use "value" and "onclick") - the entire $_actions array is passed into the form.tpl template by Jamroom, so any additional key => value pairs you want to use in your template will be available to you.
ussher, 05/09/09 00:10:42:

could we have an example of $_actions please.
You must be logged in to post a comment
Solutions Products Support Community Company
Social Media Platform
Social Networking Software
Musician Website Manager
Community Builder
Jamroom Core
Jamroom Addons
Jamroom Modules
Jamroom Marketplace
Support Forum
Documentation
Support Center
Contact Support
Community Forum
Member Sites
Developers
About Us
Contact Us
Privacy Policy
©2003 - 2012 Talldude Networks, LLC.