TOPIC:

ff_setValue() usage in Begin Submit 5 years 9 months ago #159709

  • Topic Author
  • duaccount
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 17
  • Thanks: 0
Hi,

Can we use ff_setValue() in form begin submit piece? I am trying to save an ip address in a forms hidden field before the submission of the form and using the following code in begin submit but its not working.

$this->execPieceByName('ff_InitLib');
ff_setValue("ipHidden",$_SERVER);

If the above method is incorrect, please guide me since I need to populate couple of other fields with custom values before the form submission.

Regards

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

ff_setValue() usage in Begin Submit 5 years 9 months ago #159721

  • pedro81's Avatar
  • pedro81
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 15273
  • Karma: 287
  • Thanks: 1077
Hi,

if you only want to get the user IP into a field, you can create a new element, type: hidden input, and set its value as
<?php return $_SERVER['REMOTE_ADDR']; ?>


Attachments:

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

ff_setValue() usage in Begin Submit 1 week 4 days ago #263523

  • geeksscript
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 114
  • Thanks: 1
Hi, I am facing the same issue. ff_setValue() does not seem to work in Begin Submit.

I have a code in Begin Submit and based on the code's output, I need to modify the value of hidden input element type.

For eg.
The value of variable $setNewValue is assigned to 0 by code. I do:
ff_setValue('hiddenElement1', $setNewValue);
but it does not work. May I know if ff_setValue() is not supported in Begin Submit or is there anything I am doing wrong? Please guide me.

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

ff_setValue() usage in Begin Submit 1 week 4 days ago #263524

  • Mirec's Avatar
  • Mirec
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 957
  • Karma: 2
  • Thanks: 50
Hi
ff_setValue('hiddenElement1', $setNewValue);
-ff_setValue() -->You can not use this in Submit pieces

this function you can use in form pieces -> Before Form, you can describe what you want and I will provide code for that.

Please see the link below:

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

Regards,
Mirko

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

Last edit: Post by Mirec.

ff_setValue() usage in Begin Submit 1 week 4 days ago #263525

  • geeksscript
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 114
  • Thanks: 1
Sure. This is in continuation to my post #130466
$setUserExists = 1;

$the_email_field = ff_getSubmit('email');
$dba_email = JFactory::getDBO();
$sql_email_query = "SELECT id FROM #__users WHERE email like '".$the_email_field."'";
$dba_email->setQuery($sql_email_query);
$userid = $dba_email->loadResult();

if (empty($userid)) {

// registration code goes here

$setUserExists = 0;
ff_setValue('hiddenElement1', $setUserExists);
}

So if $userid does not hold any value, it is set to 0 and then I want to update hiddenElement1's value to 1.

Please guide me how to achieve this.

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

Last edit: Post by geeksscript.

ff_setValue() usage in Begin Submit 1 week 4 days ago #263526

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

hmm...this code can be in Before form for example, because ff_setValue we can't use in submit pieces

Did you already test it?

Regards,
Tihana

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

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