我已經設置了一個鍵,並且可以讓recaptcha在頁面上顯示它自己,但我不知道如何將它變成表單。ExtJS 4 recaptcha表格
其實我不想使用一個id,因爲我稍後會在應用程序內部重複使用它,所以要使用itemId將是首選。我假設該元素尚未創建。
我包括: HTML代碼:(從recaptcha_ajax.js產生不能獲得ID爲 '驗證碼' 控制)
<script type="text/javascript" src="http://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script>
錯誤: 遺漏的類型錯誤:無法設置屬性 '的innerHTML'空
下面的代碼:
Ext.define('Login.view.Login', {
extend: 'Ext.form.Panel',
alias: 'widget.Login.view.Login',
border: false,
bodyPadding: 5,
initComponent: function() {
var config = {
layout: 'anchor',
defaultType: 'textfield',
defaults: {
anchor: '100%',
allowBlank: false
},
items: [{
fieldLabel: 'Company Id',
name: 'companyId'
},{
fieldLabel: 'Username',
name: 'username'
},{
fieldLabel: 'Password',
name: 'password',
inputType: 'password'
},{
/*xtype: 'panel',
itemId: 'reCaptcha',
border: false,*/
html: '<div id="recaptcha">adsf</div>'
}],
buttons: [{
text: 'Login'
}]
};
Ext.apply(this, config);
this.callParent();
},
afterRender: function() {
Recaptcha.create("heres_my_public_key",
document.getElementById('recaptcha'),
{
theme: "clean"/*,
callback: Recaptcha.focus_response_field*/
}
);
this.callParent();
}
});
人這樣做使用ExtJS的4?
/K
請不要在您的帖子中使用外部鏈接。如果他們打破了整個職位是毫無價值的... – sra
指出。其實很有趣。煎茶今天下來...並仍然下降。 – Asken