reading params in form

  • Balma66
  • Topic Author
  • Away
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0

Balma66 created the topic: reading params in form

Hello,

I created a form for a reservation request. It sends an email with a link and a param to a seccond form.
How to read this param in the seccond form, and loading values from the first form in the seccond?

Feike
#238643
  • Posts: 2785
  • Karma: 95
  • Thank you received: 376

mihaela replied the topic: reading params in form

Hello,

What you want can be easily done.

Go to Properties of the element in your form which you want to fill in with the value of a parameter from the link.
The in the Value field put the following code:
<?php return JRequest::getVar('name'); ?>
NOTE: Replace the name with the name of the parameter in the link.

Let me know whether this is working as you wanted.

Regards,

Mihaela
#238646
  • Balma66
  • Topic Author
  • Away
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0

Balma66 replied the topic: reading params in form

It works, I can read the param.
The second question was How can I get the values from the first form in the second form.
#238663
  • Posts: 2785
  • Karma: 95
  • Thank you received: 376

mihaela replied the topic: reading params in form

Hello,

Great, I am glad that you can read the parameters.

In order to pass values from the first form to the second one (if user is being redirected from one form to another), please take a look at this topic crosstec.org/en/forums/3-breezingforms-f...n-form-b.html#230572 .

Here what you have asked is explained. Basically, reading the params stays the same, you just need to add submitted values from the first form to URL.

Let me know whether you have managed to set this work as you want.

Regards,

Mihaela
#238666
  • Balma66
  • Topic Author
  • Away
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0

Balma66 replied the topic: reading params in form

Ok this works again Thank you.
But is it possible to read the data from a databasse table?
#238671
  • Posts: 2785
  • Karma: 95
  • Thank you received: 376

mihaela replied the topic: reading params in form

Hello again,

Yes it is possible to read from database, but you need to write the correct queries to the database.

The form data gets saved to #__facileforms_records and #__facileforms_subrecords tables.

You would have to go to form's Advanced properties > More options > Form pieces and in Before Form section set Type to Custom and in the code area below put the following code:
$this->execPieceByName('ff_InitLib');
$db = JFactory::getDBO();//Get Database Object
$db->setQuery("SELECT value from #__facileforms_subrecords WHERE element = 7929 ORDER BY id DESC"); 
$tmp= $db->loadResult() + 1;
ff_setValue('FIELDNAME',$tmp);
NOTE: In the code above replace FIELDNAME with the Name of the field in your form. Also, replace 7929 with the element number of the field in your form from which you wish to fetch the values.
This is just an example query that will fetch the last submitted value.
If you wish to fetch value submitted by a specific user you will have to look into the database structure to get the correct queries to retrieve the value, but this is the syntax.

Let me know whether this helped.

Regards,

Mihaela
#238676
Moderators: ForumSupporttomeperica
Time to create page: 0.072 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

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

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription 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 for just 49! (Summer Sale)

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!

Live Support Chat Opened!

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

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