html实现弹窗输入

<input type="button" value="生成PDF" onclick="show()">
<div id="div" style="background:#87CEFA;position:absolute;display:none;margin: auto;top:50%;left:50%;margin-top:-50px;margin-left:-250px;width:500px;height:100px;border-radius:5px;">
	<form name="form" action="pdf.php" method="post" onsubmit="return get()"><br>
		请输入付款方式:<input type="text"  name="txt"/>
		<input type="hidden" name="id" value="id"] ?>"><br /><br>
		<input type="submit" value="确定"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="返回" onclick="hidd()"/>
	</form>
</div>

<script type="text/javascript">
	function show(){
		document.getElementById('div').style.display="block";
	}
	function hidd(){
		document.getElementById('div').style.display="none";
	}
	function get(){
		var tt = document.form.txt.value;
		if(tt.length>0){
			document.getElementById('div').style.display="none";
		}else{
			alert('不能为空');
			return false;
		}
		return true;
	}
</script>


pdf.php里的代码
<?php
$fkfs=$_POST['txt'];
......
?>

你可能感兴趣的:(html实现弹窗输入)