如何将HTML内容发送到另一个HTML页面
<p>我想在一个html页面上填写一个表单,然后将填写好的表单发送到另一个html页面上进行检查并保存。我只是不知道如何将数据从一个html发送到另一个html。我请求你的帮助。谢谢</p>
<pre class="brush:php;toolbar:false;">question.html
这是表单
{% extends 'dependencies.html' %}
{% block content %}
<div class="jumbotron container row">
<div class="col-md-6">
<h1>添加问题</h1>
<div class="card card-body">
<form action="" method="POST" id="form">
{% csrf_token %}
{{form.as_p}}
<br>
<input type="submit" name="Submit">
</form>
</div>
</div>
</div>
{% endblock %}</pre>
<pre class="brush:php;toolbar:false;">approve_questions.html
我想在这里获取question.html的内容
目前为空</pre>
<pre class="brush:php;toolbar:false;">views.py
def questions(request):
form = addQuestionform()
if (request.method == 'POST'):
form = addQuestionform(request.POST)
if (form.is_valid()):
form.save(commit=False)
html = render_to_string("notification_email.html")
send_mail('The contact form subject', 'This is the message', 'noreply@codewithstein.com', ['example@gmail.com'],
html_message=html)
return redirect("login")
context = {'form': form}
return render(request, 'addQuestion.html', context)
def approve_questions(request):
return render(request, "approve_question.html")</pre>