orm) {yii.validation.string(value, messages, {"message":"マッサージ必须是一条字符串。","max":255,"tooLong":"マッサージ只能包含至多255个字符。","skipOnEmpty":1});yii.validation.required(value, messages, {"message":"マッサージが必要です."});}}], []); $("#search_form").submit(function(e){ if ($("#keywordInput").val().length==0){ alert("Keyword is required"); return false; } }); });