extjs+php, let's see if it's my little brother's question about my JSON output, or my brother's ExtJS didn't write right.

Source: Internet
Author: User
extjs+php, everyone to see is my JSON output problem, or my extjs didn't write right?
Client: Mainly look at my sole SUBM this function has no problem,
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: ' Can only be letters ',
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: ' Football ',
},
{
Columnwidth:.2,
Xtype: ' checkbox ',
Name: ' Aihao ',
Boxlabel: ' Playing football '
}

]
}
]

}

],
buttons:[
{text: ' Save ',
HANDLER:SUBM},
{text: ' Cancel '}
]




})

function SUBM () {

if (!main.isvalid ()) {
Return
}
Main.getform (). Submit ({
WAITMSG: ' Data submission ... ',
URL: './php.php ',
Method: ' POST ',
Params:main.getValues (),
Success:function (form,action) {
Alert ("OK");
},
Failure:function (form,action) {
Alert (');
}
})




}


Service side:
 
  $str =$_post["name"];
$arr =array (
"Name" = "Xiobai",
"Sex" = "28"
);
echo Json_encode ($arr);

?>


Problem he went straight failure: the function behind, why not go success:

Share to:


------Solution--------------------
You alert (form + action);
And not 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.