You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.8 KiB
55 lines
1.8 KiB
<!DOCTYPE html> |
|
<html lang="en"> |
|
<head> |
|
<meta charset="UTF-8"> |
|
<title>user_info_models</title> |
|
</head> |
|
{% load static %} |
|
<script src="{% static 'plugins/jquery-3.7.0.js' %}"></script> |
|
<body> |
|
<form action="" method="POST" novalidate> |
|
{% csrf_token %} |
|
<p>{{ form_obj.username.label }}:{{ form_obj.username }} |
|
{{ errors.username.0 }}</p> |
|
<p>{{ form_obj.password.label }}:{{ form_obj.password }} |
|
{{ errors.password.0 }}</p> |
|
<p>{{ form_obj.confirm_password.label }}:{{ form_obj.confirm_password }} |
|
{{ errors.config_password.0 }}</p> |
|
<p>{{ form_obj.status.label }}:{{ form_obj.status }} |
|
{{ errors.status.0 }}</p> |
|
<p>{{ form_obj.age.label }}:{{ form_obj.age }} |
|
{{ errors.age.0 }}</p> |
|
<p>{{ form_obj.mobile.label }}:{{ form_obj.mobile }} |
|
{{ errors.mobile.0 }}</p> |
|
{{ errors }} |
|
{# <input type="submit" value="提交">#} |
|
<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> |
|
</html> |