<div title="添加用戶" id="win" class="easyui-window" closed="true">? ? ? ? <table>? ? ? ? ? ?<tr>? ? ? ? ? ? ? ? <td>? ? ? ? ? ? ? ? ? ? 用戶賬號:? ? ? ? ? ? ? ? </td>? ? ? ? ? ? ? ? <td>? ? ? ? ? ? ? ? ? ? <input type="text" id="uAccounts" name="uAccounts" />? ? ? ? ? ? ? ? </td>? ? ? ? ? ? </tr>? ? ? ? ? ? <tr>? ? ? ? ? ? ? ? <td>? ? ? ? ? ? ? ? ? ? 用戶密碼:? ? ? ? ? ? ? ? </td>? ? ? ? ? ? ? ? <td>? ? ? ? ? ? ? ? ? ? <input id="uPassword" name="uPassword" type="text" />? ? ? ? ? ? ? ? </td>? ? ? ? ? ? </tr>? ? ? ? ? ? <tr>? ? ? ? ? ? ? ? <td>? ? ? ? ? ? ? ? ? ? 用戶姓名:? ? ? ? ? ? ? ? </td>? ? ? ? ? ? ? ? <td>? ? ? ? ? ? ? ? ? ? <input id="uName" name="uName" type="text" />? ? ? ? ? ? ? ? </td>? ? ? ? ? ? </tr>? ? ? ? ? ? <tr>? ? ? ? ? ? ? ? <td>? ? ? ? ? ? ? ? ? ? 用戶年齡:? ? ? ? ? ? ? ? </td>? ? ? ? ? ? ? ? <td>? ? ? ? ? ? ? ? ? ? <input id="uAge" name="uAge" type="text" />? ? ? ? ? ? ? ? </td>? ? ? ? ? ? </tr>? ? ? ? ? ? <tr>? ? ? ? ? ? ? ? <td>? ? ? ? ? ? ? ? ? ? 用戶性別:? ? ? ? ? ? ? ? </td>? ? ? ? ? ? ? ? <td>? ? ? ? ? ? ? ? ? ? <input id="uSex" name="uSex" type="text" />? ? ? ? ? ? ? ? </td>? ? ? ? ? ? </tr>? ? ? ? ? ? <tr>? ? ? ? ? ? ? ? <td>? ? ? ? ? ? ? ? ? ? 用戶電話號碼:? ? ? ? ? ? ? ? </td>? ? ? ? ? ? ? ? <td>? ? ? ? ? ? ? ? ? ? <input id="uPhone" name="uPhone" type="text" />? ? ? ? ? ? ? ? </td>? ? ? ? ? ? </tr>? ? ? ? ? ? <tr>? ? ? ? ? ? ? ? <td>? ? ? ? ? ? ? ? ? ? <a href="#" class="easyui-linkbutton" iconcls="icon-add" onclick="addUser()">確定</a>? ? ? ? ? ? ? ? ? ? <a href="#" class="easyui-linkbutton" iconcls="icon-cancel">關閉</a>? ? ? ? ? ? ? ? </td>? ? ? ? ? ? </tr>? ? ? ? </table>? ? </div>function addUser(){ var uAccounts=$("#uAccounts").val(); var uPassword=$("#uPassword").val(); var uName=$("#uName").val(); var uAge=$("#uAge").val(); var uSex=$("#uSex").val(); var uPhone=$("#uPhone").val(); console.info("uAccount is:"+uAccounts+"\n"+ ? ? ?"uPassword is:"+uPassword);? ? $.ajax({ ?? ? ? ? data:{? ? ? ? uAccounts:uAccounts,? ? ? ? uPassword:uPassword,? ? ? ? uName:uName,? ? ? ? uAge:uAge,? ? ? ? uSex:uSex,? ? ? ? uPhone:uPhone? ? ? ? },? ? ? ? type:"POST", ??? ? ? ? dataType: 'json', ?? ? ? ? url:"/MyHealth/html/addUser", ?? ? ? ??? ? ? ? success:function(data){? ? ? ? ? ? ? ? $("#success").window("open");? ? ? ? },? ? ? ? error:function(data){? ? ??? ? ? ? $("#error").window("open");? ? ? ? }? ? ? ?? ? ? ??? ? });? }其它數(shù)據(jù)可以拿到唯獨第一個拿不到,這是為什么?謝謝大神們!
為什么input輸入任何值都為空字符串?
qq_Crazy丶羊_0
2017-09-15 22:32:51