私はこのようなJSコードの検証を持っています:
if (theForm.chk_ccd.checked &&
(! theForm.ccd_pos [0].checked) &&
(! theForm.ccd_pos [1].checked) &&
(! theForm.ccd_pos [2].checked))
{
window.alert ('Please select data from the \"CCD Position\" field.');
theForm.ccd_pos [0].focus ();
return;
}
今、私はその関数を私の Jquery JS 関数に追加したいと思います:
function ActionAdd (theForm)
{
$().ready(function()
{
$("#form").validate(
{
rules:
{
de_no: "required",
de_name: "required",
product_name: "required",
plabel_no: "required",
},
messages:
{
de_no: "<div class='error'>Please provide Part No.</div>",
de_name: "<div class='error'>Please provide Model Name</div>",
product_name: "<div class='error'>Please provide Product Name</div>",
plabel_no: "<div class='error'>Please provide Part No. (Pack Label)</div>",
}
});
});
}
誰にも提案がありますか?