必填项星号html,怎么把带星号的必填项改为可不填?

2021年6月28日 7点热度 0条评论 来源: 呐傷.已黯淡

本帖最后由 564564564564564 于 2013-5-1 19:05 编辑

求助

file:///D:/Temp/%25W@GJ$ACOF(TYDYECOKVDYB.png问题地址:http://www.qianyulu.com/plugin.php?id=fb_opinion:main

怎么把带星号的必填项改为可不填?

代码:

$_G[setting][bbname]

$_G[setting][bbname]

{lang fb_opinion:plugin_name}
$plugin_nav

{$nologin_notice}

* {lang fb_opinion:name}       
*{lang fb_opinion:email}       
*{lang fb_opinion:phone}       
{lang fb_opinion:reside} $residehtml
*{lang fb_opinion:message}
*
{lang fb_opinion:log_title1} {lang fb_opinion:log_title2} {lang fb_opinion:log_title3} {lang fb_opinion:log_title4} {lang fb_opinion:log_title5} {lang fb_opinion:log_title6} {lang fb_opinion:log_title7}
{$loglist['name']} {$loglist['username']} {$loglist['email']} {$loglist['phone']} {$loglist['reside']} {lang fb_opinion:viewintro} $loglist[message] {$loglist[dateline]}

$multipage

function applysubmitsmt(){

var formsubmit = true;

if(!document.forms['opinion'].name.value) {

$("error_name").innerHTML = "{lang fb_opinion:needname}";

formsubmit = false;

}

if(!document.forms['opinion'].phone.value || !isInteger(document.forms['opinion'].phone.value)) {

$("error_phone").innerHTML = "{lang fb_opinion:needphone}";

formsubmit = false;

}

if(!document.forms['opinion'].message.value) {

$("error_message").innerHTML = "{lang fb_opinion:needmessage}";

formsubmit = false;

}

if(!document.forms['opinion'].email.value || !isEmail(document.forms['opinion'].email.value)) {

$("error_email").innerHTML = "{lang fb_opinion:needemail}";

formsubmit = false;

}

if(formsubmit){

document.forms['opinion'].submit();

return true;

} else {

return false;

}

}

function blurchange(elementname) {

if(elementname == '') return false;

if(elementname == 'name') {

if(!document.forms['opinion'].name.value) {

$("error_name").innerHTML = "{lang fb_opinion:needname}";

} else {

$("error_"+elementname).innerHTML = "";

}

} else if (elementname == 'email') {

if(!document.forms['opinion'].email.value || !isEmail(document.forms['opinion'].email.value)) {

$("error_email").innerHTML = "{lang fb_opinion:needemail}";

} else {

$("error_"+elementname).innerHTML = "";

}

} else if (elementname == 'phone') {

if(!document.forms['opinion'].phone.value || !isInteger(document.forms['opinion'].phone.value)) {

$("error_phone").innerHTML = "{lang fb_opinion:needphone}";

} else {

$("error_"+elementname).innerHTML = "";

}

} else if (elementname == 'message') {

if(!document.forms['opinion'].message.value) {

$("error_message").innerHTML = "{lang fb_opinion:needmessage}";

} else {

$("error_"+elementname).innerHTML = "";

}

}

}

function isInteger(str){

reg=/^[-+]?\d+$/;

if(!reg.test(str)){

return false;

} else {

return true;

}

}

function isEmail(str){

reg=/^\w{3,}@\w+(\.\w+)+$/;

if(!reg.test(str)){

return false;

} else {

return true;

}

}

{subtemplate common/footer}

    原文作者:呐傷.已黯淡
    原文地址: https://blog.csdn.net/weixin_36445866/article/details/118321151
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。