PHP中,如何做出一个弹出对话框?
3个回答
2013-07-18
展开全部
<form action="" method="post" name="myform" onsubmit="return test()"><input type="text" id="myinput"/><input type="submit" value="test"/></form><script language="javascript">function test(){var myinput=document.getElementById("myinput");if(myinput.value==null){alert("please input a value");return false;}else{return true}}</script>
展开全部
如果验证用PHP在后端,那么就用Ajax;
<form name="myform" action="" method="post">
<p>用户:<input type="text" id="username" name="username" maxsize="20" onChange="nameInfor(this.value)"/> <span id="tip1"></span></p>
<p>密码:<input type="password" name="password" maxsize="50" /> <span id="tip2"></span></p>
<input type="button" name="rgt" value="提交" onclick="dosubmit('subInfor')" />
<input type="button" name="back" value="返回" onclick="dosubmit('back')"/>
</form>
<form name="myform" action="" method="post">
<p>用户:<input type="text" id="username" name="username" maxsize="20" onChange="nameInfor(this.value)"/> <span id="tip1"></span></p>
<p>密码:<input type="password" name="password" maxsize="50" /> <span id="tip2"></span></p>
<input type="button" name="rgt" value="提交" onclick="dosubmit('subInfor')" />
<input type="button" name="back" value="返回" onclick="dosubmit('back')"/>
</form>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-07-18
展开全部
echo "<script>alert('弹出来咯~~');</script>";
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询