次のサイトをご覧ください。
http://openstrategynetwork.com/joinus
ユーザー名: uzh パスワード: osn
パスワードを入力して確認してください (登録する必要はありません)。
繰り返されるパスワードは同じですが、常に出力されます。
Passwords don't match.
何故ですか?ただし、登録ボタンを押した後 (他のフィールドを登録または入力する必要はありません)、css は一致する記号を表示します。
useraccounts
パッケージを使用しています: https://github.com/meteor-useraccounts
コード、特に私自身のテンプレートは次のとおりです: https://github.com/OpenStratNet/OSN/tree/master/client/templates/account-templates
どんな助けでも大歓迎です。
編集(私の設定ファイル):
// Options
AccountsTemplates.configure({
// preSignUpHook: function (error, state) {
// console.log("love");
// },
// defaultLayout: 'emptyLayout',
showForgotPasswordLink: true,
overrideLoginErrors: true,
enablePasswordChange: true,
// sendVerificationEmail: true,
// enforceEmailVerification: true,
//confirmPassword: true,
//continuousValidation: false,
showLabels: false,
//forbidClientAccountCreation: true,
//formValidationFeedback: true,
homeRoutePath: '/',
redirectTimeout: 2000,
//showAddRemoveServices: false,
showPlaceholders: true,
negativeValidation: true,
positiveValidation: true,
negativeFeedback: true,
positiveFeedback: true,
// Privacy Policy and Terms of Use
//privacyUrl: 'privacy',
//termsUrl: 'terms-of-use',
texts: {
sep: "OR REGISTER with your social account:",
title: {
signUp: "REGISTER by creating a new account:"
},
button: {
signUp: "REGISTER"
},
socialSignUp: "",
socialWith: ""
}
});
var submitFunction = function(error, state){
// ...
};
// remove fields and add them back in the right order
AccountsTemplates.removeField('email');
AccountsTemplates.removeField('password');
//all register fields
AccountsTemplates.addFields([
{
_id: 'firstName',
type: 'text',
placeholder: "First Name*",
required: true,
re: /^[^\d]{2,}$/i,
errStr: "Please enter your first name.",
},
{
_id: 'lastName',
type: 'text',
placeholder: "Last Name*",
required: true,
re: /^[^\d]{2,}$/i,
errStr: "Please enter your last name.",
},
{
_id: 'email',
type: 'email',
placeholder: "Email Address*",
required: true,
displayName: "email",
re: /.+@(.+){2,}\.(.+){2,}/,
errStr: 'Invalid email',
},
{
_id: 'institution',
type: 'text',
placeholder: "Institution/Company*",
required: true,
// re: /^[^\d]{2,}$/i,
minLength: 2,
errStr: "Please enter the institution or company you work for.",
},
{
_id: 'interests',
type: 'text',
placeholder: "Interests regarding Open Strategy*",
required: true,
re: /^[^\d]{2,}$/i,
errStr: "Please enter the your interests in the institution/company.",
template: 'interests'
},
{
_id: 'position',
type: 'text',
placeholder: "Position",
re: /^[^\d]{2,}$/i,
errStr: "Please enter the your position in the institution/company.",
},
{
_id: 'uploadProfile',
type: 'text',
template: 'uploadInput'
},
{
_id: 'password',
type: 'password',
placeholder: "Password*",
required: true,
minLength: 6,
errStr: 'Password must be at least six characters long',
},
{
_id: 'password_again',
type: 'password',
placeholder: "Confirm Password*",
required: true,
minLength: 6,
errStr: 'Password must be at least six characters long',
}
]);
フィールドを再度追加する前に行を追加AccountsTemplates.removeField('password_again');
すると、次のエラーが発生します。
core.js:591Uncaught エラー: password_again というフィールドが存在しません!AT.removeField @ core.js:591(匿名関数) @ at_config.js:61(匿名関数) @ at_config.js?2f3c438…:136
そしてその直後:
Uncaught TypeError: UndefinedAT._init @ client.js:146(anonymous function) @ client.js:463runStartupCallbacks @ startup_client.js:30ready @ startup_client.js:32 debug.js:41 例外のプロパティ '_id' を設定できませんテンプレート ヘルパー: TypeError: Undefined のプロパティ 'フォーム' を読み取れません?49a4c0aadab9f87c37a2964e832426eebd091e3c:469:23 at withValue ( http://localhost:3000/packages/meteor.js?9730f4ff059088b3f7f14c0672d155218a1802d4:971:17 ) at Store.onTracking ( http://localhost:3000/packages/kadira_debug.js?49a4c0aadab9f87c37a2964e832426eebd091e3c: 157:28) Object.dict.(匿名関数) ( http://localhost:3000/packages/kadira_debug.js?49a4c0aadab9f87c37a2964e832426eebd091e3c:468:39 ) http://localhost:3000/packages/peerlibrary_blaze-components.js?015f1eb30b191686b6c56: 373:21 のhttp://localhost:3000/packages/blaze.js?9391df93ba5076c2cfc61ee68724eb79b65f00d9:1650:16 のhttp://localhost:3000/packages/peerlibrary_blaze-components.js?015e1eb30Templateb191686996ef3bedbd6f926.6.3 の Functionc :6c15: _withTemplateInstanceFunc ( http://localhost:3000/packages/blaze.js?9391df93ba5076c2cfc61ee68724eb79b65f00d9:3671:12 )http://localhost:3000/packages/peerlibrary_blaze-components.js?015e1eb30b191686996f3bedbd6f966c5b6ef6c1:391:27