関数がフォームを検証するためのJSコードがありますが、今やりたいことは、「スペースが許可されていません」というメッセージとともにテキストボックスのユーザー名にスペースが入らないようにする関数を1つ追加することです。これまでの私のJSコードは次のとおりです。
$().ready(function()
{
$("#signupForm").validate(
{
rules:
{
full_name: "required",
username: {
required: true,
minlength: 2
},
password: {
required: true,
minlength: 5
},
email: {
required: true,
email: true
},
},
messages:
{
full_name: "Please enter your full name",
username:
{
required: "Please enter a username",
minlength: "Your username must consist of at least 2 characters"
},
password:
{
required: "Please provide a password",
minlength: "Your password must be at least 5 characters long"
},
email: "Please enter a valid email address"
}
});
});
誰でも私に考えを与えることができますか?ありがとう。