上面的链接在页面底部有一个表格。当提交没有值/无效值时,页面验证会重新加载页面。如何让它只显示红色验证错误并保持在底部而不重新加载到页面顶部?我所知道的这个页面唯一的 JS 如下。
function Check()
{
var returnValue = true;
if ($('#dnn_ctr612_XModPro_ctl00_ctl00_ctl00_name').val() == 'Full name')
{
$('#dnn_ctr612_XModPro_ctl00_ctl00_ctl00_name').val('');
returnValue = false;
}
if ($('#dnn_ctr612_XModPro_ctl00_ctl00_ctl00_company').val() == 'Company')
{
$('#dnn_ctr612_XModPro_ctl00_ctl00_ctl00_company').val('');
returnValue = false;
}
if ($('#dnn_ctr612_XModPro_ctl00_ctl00_ctl00_email').val() == 'Email')
{
$('#dnn_ctr612_XModPro_ctl00_ctl00_ctl00_email').val('');
returnValue = false;
}
if ($('#dnn_ctr612_XModPro_ctl00_ctl00_ctl00_phone').val() == 'Phone (optional)')
{
$('#dnn_ctr612_XModPro_ctl00_ctl00_ctl00_phone').val('');
}
if ($('#dnn_ctr612_XModPro_ctl00_ctl00_ctl00_message').val() == 'Your message')
{
$('#dnn_ctr612_XModPro_ctl00_ctl00_ctl00_message').val('');
returnValue = false;
}
return returnValue;
}