*Edit I shold have added that the preview is not a form, just html that echos the input values*Everything ive read says that to get data back from a form in the way i need it to be done, i have to use the userstate object, but now im not sure..
The view code is a mess right now because imm trying so many different things to get it sorted out but here it goes:
Code:
?php
// no direct access
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.view');
class CareerCornerViewSubmit extends JView {
function display($tpl = null) {
JHTML::_('behavior.formvalidation');
/*generate random customer ad id
* should probably be the return value from paypal
* and have it update the field via the cart
*/
//global $mainframe,$option;
$post = JRequest::get('post');
$mainframe = &JFactory::getApplication();
$school = $mainframe->getUserStateFromRequest("$option.school", 'school', '');
$address1 = $mainframe->getUserStateFromRequest("$option.address1", 'address1', '');
$city1 = $mainframe->getUserStateFromRequest("$option.city1", 'city1', '');
$state1 = $mainframe->getUserStateFromRequest("$option.state1", 'state1', '');
$zip1 = $mainframe->getUserStateFromRequest("$option.zip1", 'zip1', '');
$country = $mainframe->getUserStateFromRequest("$option.country", 'country', '');
$phone = $mainframe->getUserStateFromRequest("$option.phone", 'phone', '');
$fax = $mainframe->getUserStateFromRequest("$option.fax", 'fax', '');
$email = $mainframe->getUserStateFromRequest("$option.email", 'email', '');
$web = $mainframe->getUserStateFromRequest("$option.web", 'web', '');
$position = $mainframe->getUserStateFromRequest("$option.position", 'position', '');
$name = $mainframe->getUserStateFromRequest("$option.name", 'name', '');
$deadline = $mainframe->getUserStateFromRequest("$option.deadline", 'deadline', '');
$eoe = $mainframe->getUserStateFromRequest("$option.eoe", 'eoe', '');
$body = $mainframe->getUserStateFromRequest("$option.body", 'body', '');
$published = $mainframe->getUserStateFromRequest("$option.published", 'published', '');
$searchposition = $mainframe->getUserStateFromRequest("$option.searchposition", 'searchposition', '');
$startdate = $mainframe->getUserStateFromRequest("$option.startdate", 'startdate', '');
$reminddate = $mainframe->getUserStateFromRequest("$option.reminddate", 'reminddate', '');
$custid = $mainframe->getUserStateFromRequest("$option.custid", 'custid', '');
$adid = $mainframe->getUserStateFromRequest("$option.adid", 'adid', '');
$ative = $mainframe->getUserStateFromRequest("$option.active", 'active', '');
$adtype = $mainframe->getUserStateFromRequest("$option.adtype", 'adtype', '');
$contact = $mainframe->getUserStateFromRequest("$option.contact", 'contact', '');
$city2 = $mainframe->getUserStateFromRequest("$option.city2", 'city2', '');
$state2 = $mainframe->getUserStateFromRequest("$option.state2", 'state2', '');
$country2 = $mainframe->getUserStateFromRequest("$option.country2", 'country2', '');
$firm = $mainframe->getUserStateFromRequest("$option.firm", 'firm', '');
$alpha = $mainframe->getUserStateFromRequest("$option.alpha", 'alpha', '');
$consortium = $mainframe->getUserStateFromRequest("$option.consortium", 'consortium', '');
$busoff = $mainframe->getUserStateFromRequest("$option.busoff", 'busoff', '');
$adcost = $mainframe->getUserStateFromRequest("$option.adcost", 'adcost', '');
$address2 = $mainframe->getUserStateFromRequest("$option.address2", 'address2', '');
$firmaddress1 = $mainframe->getUserStateFromRequest("$option.firmaddress1", 'firmaddress1', '');
$firmaddress2 = $mainframe->getUserStateFromRequest("$option.firmaddress2", 'firmaddress2', '');
$firmcity = $mainframe->getUserStateFromRequest("$option.firmcity", 'firmcity', '');
$firmcountry = $mainframe->getUserStateFromRequest("$option.firimcountry", 'firmcountry', '');
$firmemail = $mainframe->getUserStateFromRequest("$option.firmemail", 'firmemail', '');
$firmfax1 = $mainframe->getUserStateFromRequest("$option.firmfax1", 'firmfax1', '');
$firmfax2 = $mainframe->getUserStateFromRequest("$option.firmfax2", 'firmfax2', '');
$firmfax3 = $mainframe->getUserStateFromRequest("$option.firmfax3", 'firmfax3', '');
$firmphone1 = $mainframe->getUserStateFromRequest("$option.firmphone1", 'firmphone1', '');
$firmphone2 = $mainframe->getUserStateFromRequest("$option.firmphone2", 'firmphone2', '');
$firmphone3 = $mainframe->getUserStateFromRequest("$option.firmphone3", 'firmphone3', '');
$firmstate = $mainframe->getUserStateFromRequest("$option.firmstate", 'firmstate', '');
$firmmzip = $mainframe->getUserStateFromRequest("$option.firmmzip", 'firmmzip', '');
$user = &JFactory::getUser();
$usergroup = $user->get('usertype');
if ($user->get('gid') == 107 || $user->get('gid') == 109 || $user->get('gid') == 25) {
$hello = "Membership status: ".$user->get('usertype');
}
if ($usergroup == "consortium") {
$cmember = "yes";
$adcost = "99";
} else {
$cmember = "no";
$adcost = "110";
}
$params = array('smilies'=>'0', 'colors'=>'0', 'fonts'=>'0', 'table'=>'0', 'media'=>'0', 'directionality'=>'0', 'insertdate'=>'0', 'inserttime'=>'0', 'fullscreen'=>'0', 'layer'=>'0', 'hr'=>'0', 'template'=>'0', 'advlink'=>'0', 'contextmenu'=>'0', 'inlinepopups'=>'0');
$model = &$this->getModel();
$document = &JFactory::getDocument();
$document->addStyleSheet($this->baseurl.'/components/com_careercorner/css/view.css');
$document->addScript($this->baseurl.'/components/com_careercorner/js/view.js');
$editor = &JFactory::getEditor();
$this->assignRef('post', $post);
$this->assignRef('get', $get);
$this->assignRef('editor', $editor);
$this->assignRef('val', $val);
$this->assignRef('cmember', $cmember);
$this->assignRef('adcost', $adcost);
$this->assignRef('greeting', $greeting);
$this->assignRef('hello', $hello);
$this->assignRef('params', $params);
$this->assignRef('school', $school);
$this->assignRef('address1',$address1);
$this->assignRef('city1',$city1);
$this->assignRef('state1',$state1);
$this->assignRef('zip1',$zip);
$this->assignRef('country',$country);
$this->assignRef('phone',$phone);
$this->assignRef('fax',$fax);
$this->assignRef('email',$email);
$this->assignRef('web',$web);
$this->assignRef('position',$position);
$this->assignRef('name',$name);
$this->assignRef('deadline',$deadline);
$this->assignRef('eoe',$eoe);
$this->assignRef('body',$body);
$this->assignRef('published',$published);
$this->assignRef('searchposition',$searchposition);
$this->assignRef('startdate',$startdate);
$this->assignRef('reminddate',$reminddate);
$this->assignRef('custid',$custid);
$this->assignRef('adid',$adid);
$this->assignRef('ative',$active);
$this->assignRef('adtype',$adtype);
$this->assignRef('contact',$contact);
$this->assignRef('city2',$city2);
$this->assignRef('state2',$state2);
$this->assignRef('country2',$country2);
$this->assignRef('firm',$firm);
$this->assignRef('alpha',$alpha);
$this->assignRef('consortium',$consortium);
$this->assignRef('busoff',$busoff);
$this->assignRef('adcost',$adcost);
$this->assignRef('address2',$address2);
$this->assignRef('firmaddress1',$firmaddress1);
$this->assignRef('firmaddress2',$firmaddress2);
$this->assignRef('firmcity',$firmcity);
$this->assignRef('firmcountry',$firmcountry);
$this->assignRef('firmemail',$firmemail);
$this->assignRef('firmfax1',$firmfax1);
$this->assignRef('firmfax2',$firmfax2);
$this->assignRef('firmfax3',$firmfax3);
$this->assignRef('firmphone1',$firmphone1);
$this->assignRef('firmphone2',$firmphone2);
$this->assignRef('firmphone3',$firmphone3);
$this->assignRef('firmstate',$firmstate);
$this->assignRef('firmmzip', $firmmzip);
parent::display($tpl);
}
}
See its a mess..
originally i did do the echo $this->post['variable-name'] and that seemed to work as long as the input fields existed on both pages but because the preview page is only echoing the data, there is no need for the input fields, so the variables aregetting lost