我有形式:
new Ext.form.FormPanel({
bodyStyle:'padding: 10px',
width:400,
renderTo: Ext.query(".foo")[0],
id: 'login-form',
bodyStyle: 'padding:15px;',
url:'1.php',
items: [
{ xtype: 'textfield',
fieldLabel: 'Login',
name: 'login'
},
{
xtype: 'textfield',
name: 'pass',
fieldLabel: 'Password',
inputType: 'password'
}],
buttons: [{
text: 'Login',
handler: function()
{ Ext.getCmp('login-form')
.getForm()
.submit();
}}]
});
错误:
未捕获您正在尝试解码无效的 JSON 字符串:
*注意:未定义的索引:在线传递 C:\xampp\htdocs\extjs\1.php *
为什么未定义?
{
xtype: 'textfield',
name: 'pass', // имя поля <input name=«pass»
fieldLabel: 'Password',
inputType: 'password' // Не просто textfield, а password
}
名称:'通过'!
我的 php 文件:
$pass = $_GET["pass"];
$json = '{"a":pass}';
echo json_decode($json);