Populate select list from joomla frontend.

  • pjfroelofs
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 42
  • Thank you received: 0

pjfroelofs replied the topic: Populate select list from joomla frontend.

Hello,
YES it works!

This is so great, many thanks.
One last question.
If I want to populate more then one select list. Is this the right syntax to do that:

$this->execPieceByName('ff_InitLib'); //Include BreezingForms Library
$db = JFactory::getDBO();//Get Database Object

$test = ff_getSubmit('bewoners');
$test = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $test);

$opts = "0;Pick a Campaign;\n";
foreach(preg_split("/((\r?\n)|(\r\n?))/", $test) as $line){
$opts.= "0;". $line .";". $line ."\n";
}

// breezingform vochtbalans2
$db->setQuery("UPDATE #__facileforms_elements SET data2 = '$opts' WHERE id = 2469");
$db->execute();
// breezingform zelfzorgmedicatie
$db->setQuery("UPDATE #__facileforms_elements SET data2 = '$opts' WHERE id = 1148");
$db->execute();
#233675
  • Posts: 1740
  • Karma: 62
  • Thank you received: 217

mihaela replied the topic: Populate select list from joomla frontend.

Hello,

I'm glad that I've helped and that it is working for now. :)

To populate two select lists your syntax isn't completely right. Use the following code:
$this->execPieceByName('ff_InitLib'); //Include BreezingForms Library
$db = JFactory::getDBO();//Get Database Object
$db2 = JFactory::getDBO();//Get another Database Object

$test = ff_getSubmit('bewoners');
$test = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $test);

$opts = "0;Pick a Campaign;\n";
foreach(preg_split("/((\r?\n)|(\r\n?))/", $test) as $line){
$opts.= "0;". $line .";". $line ."\n";
}

// breezingform vochtbalans2
$db->setQuery("UPDATE #__facileforms_elements SET data2 = '$opts' WHERE id = 2469");
$db->execute();
// breezingform zelfzorgmedicatie
$db2->setQuery("UPDATE #__facileforms_elements SET data2 = '$opts' WHERE id = 1148");
$db2->execute();

Let me know whether it works as you wanted.

Regards,

Mihaela
#233678
Moderators: ForumSupporttomeperica
Time to create page: 0.042 seconds

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99€

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

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!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here