TOPIC:

Matching database records 1 month 4 days ago #249825

  • Topic Author
  • mrperfectpz
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 344
  • Thanks: 0
How can I get a textarea values from a record_id which matches my ID in another form. i e

Form 1 record-ID = 100

Form2 textfield (ID) = 100

Get value from textarea (Join) from Form1

I hope I have explained well enough.

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

Matching database records 1 month 3 days ago #249834

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 2202
  • Karma: 3
  • Thanks: 198
Hi,

just want to be sure:
you want to get textarea values from records from Form1 which matches records from another form ->e.g Form2, and you want to show result in element?

Regards,
Tihana

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

Matching database records 1 month 3 days ago #249839

  • Topic Author
  • mrperfectpz
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 344
  • Thanks: 0
No, I would like to get a textarea value from a form which record id matches the value of a textfield in second form

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

Matching database records 1 month 3 days ago #249842

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 2202
  • Karma: 3
  • Thanks: 198
Hi,

something like this:
go to your form->Advanced->More options->Form pieces->Before form->check Custom and put this:
$this->execPieceByName('ff_InitLib'); //Include BreezingForms Library
$db = JFactory::getDBO();//Get Database Object
//Create your own query 
$db->setQuery('Select id From #__facileforms_records Where value= "WANTEDVALUE" and name="ELEMENTNAME" ');  //replace elementname with name of textfield and wantedvalue with value you want to get from textfield
$result = $db->loadResult(); //load the result from the query
ff_setValue('ElementName', $result); // populate the value in the form. Change ElementName to the real name of your element you want to populate with this

Hope this helps

Regards,
Tihana

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

Matching database records 1 month 1 day ago #249916

  • Topic Author
  • mrperfectpz
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 344
  • Thanks: 0
This doesnt seem to work. I will go into a little more detail ao you can see exactly what I need.

I have a contentbuilder view which has all the details from 'form1' with an element 'ID'. I have a button which when pressed takes the element 'ID' and passes it to 'form2' via url and places it in element 'joinID'.
Check database for matching element 'ID' and element 'joinID' and get value from element 'names' in 'form1'.

I hope this helps a little more.

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

Matching database records 1 month 1 day ago #249917

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 2202
  • Karma: 3
  • Thanks: 198
Hi,
$this->execPieceByName('ff_InitLib'); //Include BreezingForms Library
$db = JFactory::getDBO();//Get Database Object

//Create your own query 
$id='Select id From #__facileforms_records Where name= "FormName" ';  //replace FormName with name of your form

$joinID='Select joinID from #__facileforms_subrecords  where record = '."$id".' '; 
$db->setQuery($joinID);


$result = $db->loadResult(); //load the result from the query
ff_setValue('ElementName', $result); // populate the value in the form. Change ElementName to the real name of your element you want to populate with this

Hope this helps and please customize this code yourself, because I don't know correct name for your elements which you want match
Also, please check these two db tables in phpmyadmin

Regards,
Tihana

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

Last edit: Post by tihana.krivic.
Time to create page: 0.049 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!