captcha.html 1.8 KB

123456789101112131415161718192021222324252627
  1. <!--@formatter:off-->
  2. {if "[type]" == 'email'}
  3. <input type="text" name="captcha" class="form-control input-lg" data-rule="required;length(4);integer[+];remote({:url('api/validate/check_ems_correct')}, event=[event], email:#email)" />
  4. <span class="input-group-btn" style="padding:0;border:none;">
  5. <a href="javascript:;" class="btn btn-info btn-captcha btn-lg" data-url="{:url('api/ems/send')}" data-type="email" data-event="[event]">发送验证码</a>
  6. </span>
  7. {elseif "[type]" == 'mobile'/}
  8. <input type="text" name="captcha" class="form-control input-lg" data-rule="required;length(4);integer[+];remote({:url('api/validate/check_sms_correct')}, event=[event], mobile:#mobile)" />
  9. <span class="input-group-btn" style="padding:0;border:none;">
  10. <a href="javascript:;" class="btn btn-info btn-captcha btn-lg" data-url="{:url('api/sms/send')}" data-type="mobile" data-event="[event]">发送验证码</a>
  11. </span>
  12. {elseif "[type]" == 'wechat'/}
  13. {if get_addon_info('wechat')}
  14. <input type="text" name="captcha" class="form-control input-lg" data-rule="required;length(4);remote({:addon_url('wechat/captcha/check')}, event=[event])" />
  15. <span class="input-group-btn" style="padding:0;border:none;">
  16. <a href="javascript:;" class="btn btn-info btn-captcha btn-lg" data-url="{:addon_url('wechat/captcha/send')}" data-type="wechat" data-event="[event]">获取验证码</a>
  17. </span>
  18. {else/}
  19. 请在后台插件管理中安装《微信管理插件》
  20. {/if}
  21. {elseif "[type]" == 'text' /}
  22. <input type="text" name="captcha" class="form-control input-lg" data-rule="required;length(4)" />
  23. <span class="input-group-btn" style="padding:0;border:none;">
  24. <img src="{:captcha_src()}" width="100" height="40" onclick="this.src = '{:captcha_src()}?r=' + Math.random();"/>
  25. </span>
  26. {/if}
  27. <!--@formatter:on-->