View Full Version : Trouble getting ExtJS input values to pass into php variables

3 Jul 2012, 12:46 PM
Hey there, I am having some issues wrapping my head around this idea. I would appreciate any help that I can get.

The issue:
I am using Ext.JS 4 and working with a Card Layout. I have the cards all set up and the form complete, what I am trying to do is get the value that the user inputs on the card in the textfield and pass that into my php file that is supposed to hold the variable that corresponds with that input value so that I can pass the php variable within a web query string.

var aff_company_name ={
id: 'company_name',
fieldLabel:'Company Name',
value:'<?php echo $oExtForms->jsEscape($oAffiliate->company_name);?>',
maxLength: 64,
allowBlank: false,
regex: /[a-zA-Z0-9]+/,
blankText:'Enter your company name.',

This is what my php class looks like...I have changed it up quite a bit so its not finished

class affiliate{
public static $aFieldTypes = array(
'affiliate' => array(
'company_name' => 'text',
'address1' => 'text',
'address2' => 'text',
'terms' => 'text',

const table = 'affiliate';

//Constructor, setup instance
function affiliate($nId=null){
$this->init($this, self::$aFieldTypes, 'affiliate');


// Query for affiliate by id
public function get($nId){
$this->id = $nId;

If someone could help me figure this out I would greatly appreciate it. Thanks.
Oh and the ext_forms() class just specifies Json_encode.

6 Jul 2012, 2:29 PM
Why do you have your name as 'affiliate[company_name]'?

Have you looked at the network tab in dev tools to look at the request?

8 Jul 2012, 5:51 PM
I have my name as 'affiliate[company_name]' because I was thinking that I would be able to reference that name through my affiliate class object which I have defined as $oAffiliate = new affiliate(); which is wrapped in php tags at the top of my card layout class, am I going about it the wrong way?