TOPIC:

Re:Passing variables 12 years 1 month ago #14476

  • technocharged's Avatar
  • technocharged
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 5
  • Thanks: 1
I figured out how to pass the variables to another form using the following submit piece:
$this->execPieceByName('ff_InitLib');

echo '
<form name="myresubmit" action="/index.php?option=com_facileforms&ff_form=13&ff_page=1&Itemid=8" method="post" name="myresubmit" id="myresubmit">
  <input type="hidden" name="Pzip" value="'.htmlentities( ff_getSubmit('pickup_zip') ).'"/>
  <input type="hidden" name="Dzip" value="'.htmlentities( ff_getSubmit('delivery_zip') ).'"/>
  <input type="hidden" name="Mdate" value="'.htmlentities( ff_getSubmit('moving_date') ).'"/>
  <input type="hidden" name="Dtype" value="'.htmlentities( ff_getSubmit('dwelling_type') ).'"/>
</form>
<script>
//alert(document.myresubmit.Pzip.value);
document.myresubmit.submit();
</script>
';

exit;

My only remaining issue is that the form is not redirecting to the action url when using Firefox. It works in all other browsers. Any solutions? :S

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

Last edit: Post by technocharged. Reason: eliminating private data

Re:Passing variables 11 years 11 months ago #15837

  • technocharged's Avatar
  • technocharged
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 5
  • Thanks: 1
Problem Solved:

The cause of the Firefox issue was that the browser was not playing well with the hidden fields in the submit piece. The solution was to add the following line to the code:

<input type="text" name="temp" style="visibility:hidden"/>

Now the variables pass just fine and can be used to populate the value of a form field using the following line in directly in the "value" field on the form admin:

<?php return $_POST;?>
The following user(s) said Thank You: winstonp

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

Re:Passing variables 10 years 6 months ago #67636

  • winstonp
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 26
  • Thanks: 1
All,

Thanks for this thread. It helped me figure out how to do exactly what I wanted to do.

For others, who may benefit from something even simpler, the following code worked great for me, to pass a value ("data1") from one form ("form4") to another form ("form3") (NOTE: "data1", on form4, is simply a text box that allows the user to type anything. Whatever the user types, will be sent over to the next form ("form3") and assigned to a variable):

(this is typed on Edit Form, Submit Pieces, End submit, in the sending form ("form4")):

$this->execPieceByName('ff_InitLib');

echo '
<form name="form4" action="/index.php/form3" method="post">
<input type="text" name="data1" value="'.( ff_getSubmit('data1') ).'"/>

</form>
<script>
document.form4.submit();
</script>';
exit;

Then, on the receiving form ("form3"), I assigned the sent data to a variable ($myvariable) by inserting this line of code in the Form Pieces, Begin Form section:

$myvariable = $_POST["data1"];

From there, I could use $myvariable in SELECT queries, etc...

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

Last edit: Post by winstonp.
  • Page:
  • 1
  • 2
Moderators: ForumSupport
Time to create page: 0.046 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!