TOPIC:

FIELD IN CSV EXPORT FILE WITH SCORE CALCULATION AND COUNTING OF CHECK ITEMS 1 year 11 months ago #258017

  • Mirec's Avatar
  • Mirec
  • Offline
  • Platinum Member
  • Platinum Member
  • Registered
  • Posts: 3262
  • Thanks: 163
Hello,

could you please navigate in your 'Radio button field' then Go Advanced -> In Actionscript select type 'Change' and into code box insert code below:

(This is an example for radio buttons with 3 values (values1, value2, value3) and when you click on one of the offered radio buttons, the field 'total' will display how much record has that selected radio button in the database).
function ff_radiogroup_action(element, action)
{
    switch (action) {
        case 'change':
  ff_test1_action(element, action);
  ff_test2_action(element, action);
  ff_test3_action(element, action);
            
break;
        default:;
    } // switch
} // ff_radiogroup_action

// First function for values1
function ff_test1_action(element, action) //where radioelem is the name of the radio group
{

 switch (action)
     {
          case 'change':
          vals = '';
		 	  
		   jQuery.ajax({
		   
		   type: 'GET',
url: '<?php return JURI::root(true ); ?>/value.php ',
data: 'test',
success: function(data){

opts = JQuery("[name=\"ff_nm_radiogroup[]\"]");
          for (o = 0; o < opts.length; o++)
          if (opts[o].checked)
          {
               vals = opts[o].value;
          }
          if (vals=="value1") // here you can add further dependencies
          {
              return ff_getElementByName('text').value = data;
          }
         		   
}
		   });
		    
		            break;
		  
          default:;
		  		  
		  }
}


// Seconds function for values2
function ff_test2_action(element, action) //where radioelem is the name of the radio group
{

 switch (action)
     {
          case 'change':
          vals = '';
		 	  
		   jQuery.ajax({
		   
		   type: 'GET',
url: '<?php return JURI::root(true ); ?>/value1.php ',
data: 'test',
success: function(data){

opts = JQuery("[name=\"ff_nm_radiogroup[]\"]");
          for (o = 0; o < opts.length; o++)
          if (opts[o].checked)
          {
               vals = opts[o].value;
          }
          if (vals=="value2") // here you can add further dependencies
          {
              return ff_getElementByName('text').value = data;
          }
         
		   
}
		   });
		  
		  
		            break;
		  
          default:;
		  
		  		  }
}


//Third function for values3

function ff_test3_action(element, action) //where radioelem is the name of the radio group
{

 switch (action)
     {
          case 'change':
          vals = '';
		 	  
		   jQuery.ajax({
		   
		   type: 'GET',
url: '<?php return JURI::root(true ); ?>/value2.php ',
data: 'test',
success: function(data){

opts = JQuery("[name=\"ff_nm_radiogroup[]\"]");
          for (o = 0; o < opts.length; o++)
          if (opts[o].checked)
          {
               vals = opts[o].value;
          }
          if (vals=="value3") // here you can add further dependencies
          {
              return ff_getElementByName('text').value = data;
          }
         
		   
}
		   });
		  
		  
		            break;
	      default:;
			  }
}


Then, in your server (joomla root) make three PHP files with a different name (in this case, 'value1', 'value2', 'value3 ') which you will be insert into JS code (On this line kode : url: '<?php return JURI::root(true ); ?>/value1.php ',).

In all PHP files input this code:
<?php
define( '_JEXEC', 1 );
define( 'JPATH_BASE', realpath(dirname(__FILE__).'/' )); 
require_once ( JPATH_BASE .'/includes/defines.php' );
require_once ( JPATH_BASE .'/includes/framework.php' );
 
$db = JFactory::getDBO(); 
$db->setQuery('SELECT Count(*) FROM `wlrak_facileforms_subrecords` WHERE value="Value1"'); 
$result = $db->loadResult()+1;

echo json_encode($result);

?>

Please, in PHP code replace the condition in SQL query 'where value="" ' for search different values of a selected radio button.

In attach file I sent to you may test example. Please download->unzip->and install it (BF->Configuration->Package Installer->select this xml file->Install Package).

regards!
Mirko

Please Log in or Create an account to join the conversation.

FIELD IN CSV EXPORT FILE WITH SCORE CALCULATION AND COUNTING OF CHECK ITEMS 1 year 11 months ago #258049

  • Topic Author
  • dvddvddvd
  • Offline
  • New Member
  • New Member
  • Registered
  • Posts: 13
  • Thanks: 0
Hello Mikro,

Where is the attach file

thanks for your dedication and effort

Please Log in or Create an account to join the conversation.

FIELD IN CSV EXPORT FILE WITH SCORE CALCULATION AND COUNTING OF CHECK ITEMS 1 year 11 months ago #258052

  • Mirec's Avatar
  • Mirec
  • Offline
  • Platinum Member
  • Platinum Member
  • Registered
  • Posts: 3262
  • Thanks: 163
Hello,

sorry, my mistake, I hope so that now is okay.

Best regards!
Mirko
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.043 seconds

Support Chat

Join our Discord chat and enter the Crosstec channels for live-support, chat forums and interact directly with the community!

After joining, please enter the Crosstec Area and use the #crosstec-support or #crosstec-general channels.

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Subscribe to news and updates!

Special Offer

Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here and enter the Crosstec channels to receive live support and talk directly to the team!