Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[求助] 怎么把带星号的必填项改为可不填?

[复制链接]
564564564564564 发表于 2013-5-1 19:25:07 | 显示全部楼层 |阅读模式
00222222222222.png (11.25 KB, 下载次数: 0)
求助
问题地址:http://www.qianyulu.com/plugin.php?id=fb_opinion:main
怎么把带星号的必填项改为可不填?

代码:
< !--{subtemplate common/header}-->
<div id="pt" class="bm cl">
    <div class="z"><a href="./" class="nvhm">$_G[setting][bbname]</a><em>&#8250;</em><a href="./">$_G[setting][bbname]</a> <em>&#8250;</em><a href="plugin.php?id=fb_opinion:main">{lang fb_opinion:plugin_name}</a> <em>&#8250;</em>$plugin_nav</div>
< /div>
< div id="ct" class="ct2 wp cl">
    <div class="mn">
        <div class="bm bw0">
            <div class="bm bw0">
                <ul class="tb cl">
                    <li <!--{if $_G[gp_mod] == 'apply' || empty($_G[gp_mod])}-->class="a"<!--{/if}-->><a href="plugin.php?id=fb_opinion:main&mod=apply">{lang fb_opinion:tab_apply}</a></li>
                    <!--{if !empty($_G[uid])}--><li <!--{if $_G[gp_mod] == 'log'}-->class="a"<!--{/if}-->><a href="plugin.php?id=fb_opinion:main&mod=log">{lang fb_opinion:tab_log}</a></li><!--{/if}-->
                </ul>
                <div class="datalist" style="margin:20px 0 0 0;">
                    <!--{if $_G[gp_mod] == 'apply' || empty($_G[gp_mod])}-->
                    <!--{if empty($_G[uid])}-->
                    <div style="border:1px dashed #f60; background-color:#FFC" class="notice">{$nologin_notice}</div>
                    <!--{/if}-->
                    <form method="post" action="plugin.php?id=fb_opinion:main&mod=apply&applysubmit=true" enctype="multipart/form-data" name="opinion" autocomplete="off">
                        <input type="hidden" name="referer" value="$_G[referer]">
                        <input type="hidden" name="formhash" value="{FORMHASH}" />
                        <table width="100%" border="1" bordercolor="#cccccc">
                            <tr>
                                <td width="100" height="35" bgcolor="#F2F2F2" align="center"><span style="color:red;">*</span> {lang fb_opinion:name}</td>
                                <td colspan="2">   <input type="text" name="name" style="width:220px; height:22px; line-height22px;" value="$_G[member][realname]"/>    <span style="color:red;" id="error_name"></span></td>
                            </tr>
                            <tr>
                                <td height="35" bgcolor="#F2F2F2" align="center"><span style="color:red;">*</span>{lang fb_opinion:email}</td>
                                <td colspan="2">   <input type="text" name="email" value="$_G[member][email]" style="width:220px; height:22px; line-height22px;" />   <span style="color:red;" id="error_email"></span></td>
                            </tr>
                            <tr>
                                <td height="35" bgcolor="#F2F2F2" align="center"><span style="color:red;">*</span>{lang fb_opinion:phone}</td>
                                <td colspan="2">   <input type="text" name="phone" value="$_G[member][mobile]" style="width:220px; height:22px; line-height22px;" />   <span style="color:red;" id="error_phone"></span></td>
                            </tr>
                            <tr>
                                <td height="35" bgcolor="#F2F2F2" align="center">{lang fb_opinion:reside}</td>
                                <td colspan="2"><div style="width:96%;margin:5px auto;">$residehtml</div></td>
                            </tr>
                            <tr>
                                <td bgcolor="#F2F2F2" align="center"><span style="color:red;">*</span>{lang fb_opinion:message}</td>
                                <td colspan="2">
                                    <div class="tedt" style="width:96%;margin:5px auto;">
                                        <div class="area">
                                            <textarea rows="5" cols="20" name="message" class="pt" id="replymessage"></textarea>
                                        </div>
                                    </div>
                                       <span style="color:red;" id="error_message"></span>
                                </td>
                            </tr>
                            <!--{if checkperm('seccode') && ($secqaacheck || $seccodecheck)}-->                           
                                <!--{block sectpl}--> <tr><td height="35" bgcolor="#F2F2F2" align="center"><span style="color:red;">*</span><sec></td><td colspan="2"> <div style="width:96%;margin:5px auto;"><sec><sec></div></td></tr><!--{/block}-->
                                <!--{subtemplate common/seccheck}-->                           
                            <!--{/if}-->
                        </table>
                        <div style="text-align:center; margin-top:20px;">
                            <input type="button" name="applysubmit" id="applysubmit" value="{lang fb_opinion:submit}" class="a_submit_btn1"/>   
                            <input type="reset" name="sendreset" class="a_submit_btn2" value="{lang fb_opinion:reset}"/>
                        </div>
                    </form>
                    <!--{elseif $_G[gp_mod] == 'log' && $_G['uid']!=''}-->
                    <table width="100%" border="1" bordercolor="#cccccc">
                        <tr bgcolor="#F2F2F2" align="center">
                            <td width="60">{lang fb_opinion:log_title1}</td>
                            <td height="35" >{lang fb_opinion:log_title2}</td>
                            <td width="100">{lang fb_opinion:log_title3}</td>
                            <td width="80">{lang fb_opinion:log_title4}</td>
                            <td width="180">{lang fb_opinion:log_title5}</td>
                            <td width="100">{lang fb_opinion:log_title6}</td>
                            <td width="100">{lang fb_opinion:log_title7}</td>
                        </tr>
                        <!--{loop $loglists $loglist}-->
                        <tr align="center">
                            <td height="35">{$loglist['name']}</td>
                            <td>{$loglist['username']}</td>
                            <td>{$loglist['email']}</td>
                            <td>{$loglist['phone']}</td>
                            <td>{$loglist['reside']}</td>
                            <td><span id="viewmsg_$loglist[id]"><a href="javascript:;" class="red">{lang fb_opinion:viewintro}</a></span>
                                <div id="viewmsg_$loglist[id]_menu" style="display:none; border:1px solid #ccc; background-color:#F2F2F2; padding:10px; text-align:left; width:300px;">$loglist[message]</div></td>
                            <td>{$loglist[dateline]}</td>
                        </tr>
                        <!--{/loop}-->
                    </table>
                    <div style="clear:both"></div>
                    <div style="margin-top:20px;">$multipage</div>
                    <!--{/if}-->
                </div></div>

        </div>
    </div>
    <!--{template fb_opinion:side}-->
< /div>
< script type="text/javascript">
    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;
        }  
    }
   
< /script>
{subtemplate common/footer}
fgdfhdgh 发表于 2013-5-3 11:16:17 | 显示全部楼层
知道了 不错~~~        CX采集全面支持DZ三点零版本,需要的朋友可以联系Q.Q.三一三七六五四八八
回复

使用道具 举报

可爱的轩轩 发表于 2013-5-5 05:42:45 | 显示全部楼层
这是你自己做的分类信息吧
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-9-22 07:26 , Processed in 0.254745 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表