TOPIC:

Search Select from list field for desire option 3 weeks 2 days ago #259609

  • Mirec's Avatar
  • Mirec
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 206
  • Karma: 2
  • Thanks: 3
Hello,

you can fill textfile with data from the database, bud I'm not sure is it possible to search the database over the text field?

I need Investigation it and I will back to you!

Regards!
Mirko

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

Search Select from list field for desire option 3 weeks 2 days ago #259610

  • Topic Author
  • papin0
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 77
  • Thanks: 0
Is basically this: crosstec.org/en/forums/3-breezingforms-f...-a-table.html#241741

But I need to type a Drug name and populate a select list with all the drugs that contain the text you type on the text field.

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

Search Select from list field for desire option 3 weeks 2 days ago #259613

  • Mirec's Avatar
  • Mirec
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 206
  • Karma: 2
  • Thanks: 3
Hi,

This is code for populate select list from databse:
Go -> Andvensed -> More Option -> Form Pieces ->Before Form, select ' Custom':
$this->execPieceByName('ff_InitLib'); //Include BreezingForms Library
$db = JFactory::getDBO();//Get Database Object
  
//Create your own query here
$db->setQuery('Select username From #__users '); 
  
$result = $db->loadColumn(); //load the result from the query
$test = "";
for ($i = 0; $i < count($result); $i++)
{
     $test .= "0;".$result[$i].";".$result[$i]."\n";
}
 
function ff_setSelectList($name, $value)
{
     global $ff_processor;
     for ($r = 0; $r < $ff_processor->rowcount; $r++)
     {
          $row =& $ff_processor->rows[$r];
          if ($row->name==$name)
          $row->data2 = $value;
          unset($row);
     } // for
} // ff_setSelectList
 
ff_setSelectList('select1', $test);
Please see link below:

crosstec.org/en/support/online-documenta...ct-list-from-db.html

About this piece of code depends on which data will be filled in the field select list.
$db->setQuery('Select username From #__users ' where textfield=""); 

You need to grab the value form the textfield and insert in the condition in SQL query 'where'


If you get stuck, let me know and I will help you!
Regards!
Mirko

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

Search Select from list field for desire option 3 weeks 4 hours ago #259747

  • Topic Author
  • papin0
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 77
  • Thanks: 0
Thank you, everyone
Is working as expected

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

Search Select from list field for desire option 2 weeks 6 days ago #259763

  • Mirec's Avatar
  • Mirec
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 206
  • Karma: 2
  • Thanks: 3
Hello,

super! :)

If you need help in the future, please let me know!
Regards!
Mirko

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

Time to create page: 0.048 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

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

Special Offer

Summer 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!