JavaScript警报弹出窗体 [英] Javascript alert popup form
问题描述
我有搜索整个网站和谷歌,但无法找到它,这里去!
我想用一种方式来显示表单时使用警报。例如,当用户单击帖子时,会弹出一个对话框,询问用户几个问题,如HTML表单,并允许用户单击提交或重置或取消,而无需加载新页面。
我已经看到完成,但无法再次找到相同的网站。
我曾尝试将htm警告,发布的成功几乎没有。
任何帮助都得到高度评价!
您正在寻找的是提示框:
< script type =text / javascript>
function show_prompt(){
var name = prompt('请输入您的名字','Poppy');
if(name!= null&& name!=){
alert(name);
}
}
< / script>
示例来自这里: http://www.w3schools.com/js/js_popup.asp
i have search this whole site and google but cannot find it so, here goes!
i would like a way to show a form when using alert.
for example, when user click post, a dialog pop with asking user a few question like a html form and allow user to click submit or reset or cancel, without loading a new page.
i have seen this done but cannot find the same site again.
i have tried putting htm to alert with little success of posting.
any Help is Highly Appreciated!
What you are looking for is a Prompt Box:
<script type="text/javascript">
function show_prompt() {
var name = prompt('Please enter your name','Poppy');
if (name != null && name != "") {
alert(name);
}
}
</script>
example taken from here: http://www.w3schools.com/js/js_popup.asp
这篇关于JavaScript警报弹出窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!