Extjs + php. let's take a look at the problem related to my younger brother's json output, or is my extjs not correct?

Source: Internet
Author: User
Extjs + php. let's take a look at the question of my json output, or is my extjs not correct? Client: it mainly depends on the subm function on the sole. var & nbsp; main = new & nbsp; Ext. formPanel ({title: 'user registration', width: 500, extjs + php. let's take a look at the question of my json output, or is my extjs not correctly written?
Client: it mainly depends on the subm function on my sole,
Var main = new Ext. FormPanel ({
Title: 'user registration ',
Width: 500,
Frame: true,
BodyStyle: 'Margin: 10px ;',
RenderTo: 'tool ',
Height: 400,

Items :[
{
Layout: 'column ',
Border: false,
Items :[
{ColumnWidth:. 4,
Xtype: 'textfield ',
FieldLabel: 'name ',
LabelWidth: 30,
Regex:/^ [0-9a-zA-Z \.] + $ /,
RegexText: 'Only letters are allowed ',
RegexTextWidth: 300,
AllowBlank: false,
Name: 'name'

},{
ColumnWidth: 0.6,
Layout: 'column ',
BodyStyle: 'margin-left: 20px ',
Border: false,
Items :[

{
ColumnWidth:. 2,
Xtype: 'checkbox ',
Name: 'aihao ',
BoxLabel: 'soccer ',
},
{
ColumnWidth:. 2,
Xtype: 'checkbox ',
Name: 'aihao ',
BoxLabel: 'Soccer play'
}

]
}
]

}

],
Buttons :[
{Text: 'Save exist ',
Handler: subm },
{Text: 'Taobao '}
]




})

Function subm (){
 
If (! Main. isValid ()){
Return;
}
Main. getForm (). submit ({
WaitMsg: 'Data is being submitted ....',
Url: './php. php ',
Method: 'post ',
Params: main. getValues (),
Success: function (form, action ){
Alert ("OK ");
},
Failure: function (form, action ){
Alert ('');
}
})




}


Server:
 $str=$_POST["name"];
$arr=array(
"name"=>"xiobai",
"sex"=>"28"
);
echo json_encode($arr);

?>


The problem is that he directly goes through failure: the function below, why not go to success: share:
------ Solution --------------------
You alert (form + action );
Instead of alert ('');

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.