|
|
@ -4,6 +4,8 @@ |
|
|
|
<meta charset="UTF-8"> |
|
|
|
<meta charset="UTF-8"> |
|
|
|
<title>user_info_models</title> |
|
|
|
<title>user_info_models</title> |
|
|
|
</head> |
|
|
|
</head> |
|
|
|
|
|
|
|
{% load static %} |
|
|
|
|
|
|
|
<script src="{% static 'plugins/jquery-3.7.0.js' %}"></script> |
|
|
|
<body> |
|
|
|
<body> |
|
|
|
<form action="" method="POST" novalidate> |
|
|
|
<form action="" method="POST" novalidate> |
|
|
|
{% csrf_token %} |
|
|
|
{% csrf_token %} |
|
|
@ -20,8 +22,34 @@ |
|
|
|
<p>{{ form_obj.mobile.label }}:{{ form_obj.mobile }} |
|
|
|
<p>{{ form_obj.mobile.label }}:{{ form_obj.mobile }} |
|
|
|
{{ errors.mobile.0 }}</p> |
|
|
|
{{ errors.mobile.0 }}</p> |
|
|
|
{{ errors }} |
|
|
|
{{ errors }} |
|
|
|
<input type="submit" value="提交"> |
|
|
|
{# <input type="submit" value="提交">#} |
|
|
|
</form> |
|
|
|
<button id="submit">提交</button> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</form> |
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
|
|
$('#submit').click(function () { |
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
|
|
url: "/userinfomodelsave/", |
|
|
|
|
|
|
|
async: true, |
|
|
|
|
|
|
|
type: "post", |
|
|
|
|
|
|
|
data: { |
|
|
|
|
|
|
|
username: $("#id_username").val(), |
|
|
|
|
|
|
|
password: $("#id_password").val(), |
|
|
|
|
|
|
|
confirm_password: $("id_confirm_password").val(), |
|
|
|
|
|
|
|
status: $("id_status").val(), |
|
|
|
|
|
|
|
age: $("id_age").val(), |
|
|
|
|
|
|
|
mobile: $("id_mobile").val(), |
|
|
|
|
|
|
|
"csrfmiddlewaretoken": $("[name='csrfmiddlewaretoken']").val() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
success: function (data) { |
|
|
|
|
|
|
|
consile.log(data); |
|
|
|
|
|
|
|
alter(data.msg); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
error: function (jqXHR, testStatus, err) { |
|
|
|
|
|
|
|
console.log(argument); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
</script> |
|
|
|
</body> |
|
|
|
</body> |
|
|
|
</html> |
|
|
|
</html> |