Die Daten in meinem Formular können nicht erkannt werden. Können Sie mir helfen, herauszufinden, was falsch ist?
P粉839588266
P粉839588266 2023-10-08 09:31:17
0
2
511

<div class="layadmin-user-login-boxlayadmin-user-login-bodylayui-form">

<form class="layui-form login-form">

<div class ="layui-form-item">

<label class="layadmin-user-login-iconlayui-iconlayui-icon-username" for="account"></label>


<input type="text" id="account" name="account" placeholder="请输入账号" class="layui-input" value="">

</div>

< div class="layui-form-item">

<label class="layadmin-user-login-iconlayui-iconlayui-icon-password" for="password"></label>

<input type="password" name="password" class="layui-input" placeholder="请输入密码" id="password"class="layui-input" value="">

</ div>

<div class="layui-form-item">

<div class="layui-row">

<div class="layui-col-xs7">

<label class="layadmin-user-login-iconlayui-iconlayui-icon-vercode" for="code"></label>

<input type="text"id="code" name ="code" placeholder="图形验证码" class="layui-input">

</div>

<div class="layui-col-xs5">

<div style= "margin-left:10px;">

<img src="{:captcha_src()}" onclick="reloadimg()" id="img" style="height: 38px;width: 130px">

</div>

</div>

</div>

</div>

<div class="layui-form-item" style="margin-bottom: 20px ;">

<input type="checkbox" name="remember"lay-skin="primary" title="记住密码">

</div>

</form>

<script type="text/javascript">

layui.use(['layer','form'],function(){

var form =layui.form ;

layer =layui.layer;

$ =layui.jquery;

// 用户名控件获取焦点

$('#account').focus();

});

function login( ){

var account = $('#account').val();

        var password = $('#password').val();

        var code = $('#code').val ();

$.post("login",{

      account: account,

      Passwort: Passwort,

      code:code

    },function(response){

      console.log(response);

    },'json');

}


P粉839588266
P粉839588266

Antworte allen(1)
phpcn牛

不太懂你的问题,但是你可以用一下这个

$(form).serialize();

或者是

$(form).serializeArray();

试试看。

  • Antwort 好的,谢谢
    P粉839588266 Autor 2023-10-10 10:36:38
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!