实际上在我的网站上有一些下载pdf按钮(单独的单独的pdf文件),当我点击下载pdf按钮时,将打开一个弹出窗体,有两个提交(姓名和电子邮件)我提交该字段后将提交意味着时间将下载相关的pdf文件,以便如何工作请任何人帮助我。
这是我的Html代码:
<div class="pdfdwnld">
<a href="javascript:;" class="pdfbtn" data-toggle="modal" data-target="#myModal">Download Pdf</a>
</div>
<div class="modal fade in" id="myModal" role="dialog">
<div class="modal-dialog modal-lg">
<form data-toggle="validator" role="form" id="frm">
<div class="modal-content col-lg-6 text-center">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" style="margin-bottom: 10px;">×</button>
<h5 class="modal-title text-center">Submit your E-Mail for Download PDF</h5>
</div>
</div>
</div>
</form>
</div>
</div>
答案 0 :(得分:0)
</div>
等)<div class="pdfdwnld">
<a href="javascript:;" class="pdfbtn" data-toggle="modal" data-target="#myModal">Download Pdf</a>
</div>
<div class="modal fade in" id="myModal" role="dialog">
<div class="modal-dialog modal-lg">
<!-- Add action and method to form tag -->
<form action="download.php" method="post" data-toggle="validator" role="form" id="frm">
<div class="modal-content col-lg-6 text-center">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" style="margin-bottom: 10px;">×</button>
<h5 class="modal-title text-center">Submit your E-Mail for Download PDF</h5>
</div>
<!-- Add your input fields -->
<div class="modal-body">
<div class="form-group">
<label for="nameInput">Name</label>
<input type="text" class="form-control" name="name" id="nameInput" placeholder="Name">
</div>
<div class="form-group">
<label for="emailInput">Email</label>
<input type="email" class="form-control" name="email" id="emailInput" placeholder="Email">
</div>
</div>
<div class="modal-footer">
<input type="submit" value="download" class="btn btn-primary">
</div>
</div>
</form>
</div>
</div>
从我的评论中你可以看出,你只需要创建HTML(如在前端中)(尽管我可能会误解它)。
如果是这种情况,则其他人(您的后端开发人员)必须创建在提交表单时实际下载PDF的功能
有关如何使用php文件下载PDF的更多信息,请访问: https://stackoverflow.com/a/17310470/4666299