Passing variables - Crosstec
Welcome, Guest
Please Login or Register.    Lost Password?
Go to bottomPage: 12
TOPIC: Passing variables
#14476
Re:Passing variables 2 Months ago Karma: 0
I figured out how to pass the variables to another form using the following submit piece:

Code:


$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?
technocharged
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
Gender: Male ASK4Tech andy_ask4tech Location: NC USA Birthday: 06/08
Last Edit: 2010/08/17 23:01 By technocharged.Reason: eliminating private data
The administrator has disabled public write access.
 
#15837
Re:Passing variables 2 Weeks, 6 Days ago Karma: 0
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['Pzip'];?>
technocharged
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
Gender: Male ASK4Tech andy_ask4tech Location: NC USA Birthday: 06/08
The administrator has disabled public write access.
 
Go to topPage: 12
Moderators: TheMuffinMan