I have a form that needs to post to another form (which is an outside form). I have the 1st form set up with the action to the url and method post. However, it is using JForm
. It is working fine on the 1st form and saving to the database and opening up for editing. However, there is a second action via javascript that POSTs to another page with the new form.
After the page load, I inspect the POST and it shows:
Headers Post HTML Cache Cookies
Parts multipart/form-data
jform[id] 0
jform[state] 1
jform[created_by] 23
jform[grant_type] A
jform[cycle]
jform[salutation] M
jform[first_name] vrvervtervtgbver
jform[last_name] rtrgver
jform[title] rvert
jform[company_name] trvrvetrb
jform[email_address] trbrtbeb@fgrewgrg.com
I can not for the life of me, grab this post data. I have tried everything I can think of using jinput
and $_POST
, but nothing seems to work. It either displays Array(0){[id]=>"" ...
, or NULL
, or just ARRAY
. I can not use the Database, for this action as it needs come over via post.
Does anyone have any suggestions?
Here's my code as of right now:
<?php
/**
* @version 1.2.0
* @package com_sfinnovate
* @copyright Copyright (C) 2014. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Matt Dray <matt@sooyco.com> - http://www.aespire.com
*/
// no direct access
defined('_JEXEC') or die;
$doc =& JFactory::getDocument();
$doc->addStyleSheet('components/com_sfinnovate/innovatestyle.css');
JHtml::_('behavior.keepalive');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
//Load admin language file
$lang = JFactory::getLanguage();
$lang->load('com_sfinnovate', JPATH_ADMINISTRATOR);
$doc = JFactory::getDocument();
$doc->addScript(JUri::base() . '/components/com_sfinnovate/assets/js/form.js');
if($this->item->id) {
$canState = JFactory::getUser()->authorise('core.edit.state','com_sfinnovate.innofundapp');
} else {
$canState = JFactory::getUser()->authorise('core.edit.state','com_sfinnovate.innofundapp.'.$this->item->id);
}
$jinput = JFactory::getApplication()->input;
$fooValues = $jinput->get('jform', NULL, NULL);
var_dump($fooValues);
?>
<script type="text/javascript">
getScript('//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', function() {
jQuery(document).ready(function() {
jQuery('#form-innofundapp').submit(function(event) {
});
});
});
</script>
<div class="innofundapp-edit front-end-edit">
<?php if (!empty($this->item->id)): ?>
<h1>Edit <?php echo $this->item->id; ?></h1>
<?php else: ?>
<h1>Add</h1>
<?php endif; ?>
$jinput->get('jform', NULL, 'ARRAY');
, but I'm not sure I'm following everything... – David Fritsch Aug 27 '14 at 15:22