求助 版主:论坛审计组
注册会员发送短信验证码,一直提示手机号码格式不正确
类型:迅睿CMS 更新时间:2017-12-21 11:40:33
回帖
  • 林正英
    #1楼    林正英
    2017-12-20 17:47:04
    0
    你样式不对呢,不是默认模板吧?看看你的form哈submit函数
  • 周大帅
    #2楼    周大帅
    2017-12-20 17:50:20
    0
    <form action="" class="form-horizontal form" method="post" name="myform" id="myform">
    就是默认模板复制来的。。还没到提交表单,只是点 发送验证码
    【林正英】1楼
  • 林正英
    #3楼    林正英
    2017-12-20 18:03:37
    0
    submit函数是什么?
  • 周大帅
    #4楼    周大帅
    2017-12-20 18:04:44
    0
    <form action="" class="form-horizontal form" method="post" name="myform" id="myform">
                                        {$form}
                                        <div class="form-body" style="padding-bottom:0">
    
                                            {if in_array('username', $register.field)}
                                            <div class="form-group" id="dr_row_username">
                                                <label class="col-md-2 control-label">账号</label>
                                                <div class="col-md-9">
                                                    <label><input type="text" class="form-control input-large" name="data[username]" id="dr_username"></label>
                                                </div>
                                            </div>
                                            {/if}
                                            {if in_array('email', $register.field)}
                                            <div class="form-group " id="dr_row_email">
                                                <label class="col-md-2 control-label">邮箱</label>
                                                <div class="col-md-9">
                                                    <label><input type="text" class="form-control input-large" name="data[email]" id="dr_email"></label>
                                                </div>
                                            </div>
                                            {/if}
                                            {if in_array('phone', $register.field)}
                                            <div class="form-group " id="dr_row_phone">
                                                <label class="col-md-2 control-label">手机号</label>
                                                <div class="col-md-9">
                                                    <label><input type="text" class="form-control input-large" name="data[phone]" id="dr_phone"></label>
                                                </div>
                                            </div>
                                            {/if}
                                            <div class="form-group " id="dr_row_password">
                                                <label class="col-md-2 control-label">密码</label>
                                                <div class="col-md-9">
                                                    <label><input type="password" class="form-control input-large" name="data[password]" id="dr_password"></label>
                                                </div>
                                            </div>
                                            <div class="form-group " id="dr_row_password2">
                                                <label class="col-md-2 control-label">确认密码</label>
                                                <div class="col-md-9">
                                                    <label><input type="password" class="form-control input-large" name="data[password2]" id="dr_password2"></label>
                                                </div>
                                            </div>
                                            {$myfield}
                                            {if $register.code}
                                            <div class="form-group" id="dr_row_code">
                                                <label class="col-md-2 control-label">验证码</label>
                                                <div class="col-md-9">
                                                    <div class="input-group input-large">
                                                        <input class="form-control placeholder-no-fix" type="text" autocomplete="off" id="dr_code" name="code">
                                                        <div class="input-group-btn fc-code">
                                                            {dr_code(120, 35)}
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            {/if}
                                            {if $register.sms}
    <div class="mui-input-row">
    	<label>验证码</label>
    	<input type="text" id="dr_sms" name="data[sms]" class="mui-input-clear mui-input" placeholder="手机验证码">
    	<button class="mui-btn mui-btn-warning but-yzm" type="button" onclick="dr_ajax_url('index.php?s=member&c=api&m=register_code&id='+$('#dr_value').val())">发送验证码</button>
    </div>
    {/if}
                                            <div class="form-actions" style="margin-top:30px">
                                                <label class="col-md-2 control-label"></label>
                                                <div class="col-md-9" style="padding-left:5px;">
                                                    <label><button type="button" class="btn red" onclick="dr_ajax_member('{dr_now_url()}', 'myform');"> 立即注册</button></label>
                                                    <label class="mt-checkbox mt-checkbox-outline" style="margin-left:20px;">
                                                        <input type="checkbox" name="is_protocol" value="1" checked> 我已阅读并同意
                                                        <span></span>
                                                    </label>
                                                    <label>
                                                        <a href="javascript:dr_show_protocol();">《用户注册协议》</a>
                                                    </label>
                                                </div>
                                            </div>
                                        </div>
                                    </form>
    【林正英】3楼
  • 一副笑脸
    #5楼    一副笑脸
    2017-12-20 18:36:34
    0
    这部分代码没有问题,还要看看你页面上是否存在多个 myform
  • 周大帅
    #6楼    周大帅
    2017-12-21 09:16:15
    0
    就一个,但就是不行,【一副笑脸】5楼
  • 小刘
    #7楼    小刘
    2017-12-21 10:44:49
    0
    你写错代码了,不应该是dr_value,用他的方法吧http://www.finebug.com/7324.html,我是用的他的
  • 周大帅
    #8楼    周大帅
    2017-12-21 10:58:43
    0
    dr_value 是用于找回密码页面的 账号通用字段 吧?【小刘】7楼
  • 周大帅
    #9楼    周大帅
    2017-12-21 11:40:30
    0

    已解决,原因是参考此帖 http://www.finebug.com/7324.html

    由于原帖作者之前发布的代码截图不完整,导致功能无法使用,在我反馈后,作者帖出完整代码后,正常使用了。

    满意答案
  • 周大帅
    #10楼    周大帅
    2017-12-21 11:40:33
    0
    感谢大家给我解决此问题,我已经完美的解决