admin管理员组文章数量:1278919
In my asp page, i want to show a popup window whenever user clicks the button.The popup window contains one text box and submit button for getting the filepath from the user.
for example : i want a popup like this in stackoverflow site...
Please hele me to get this...
In my asp page, i want to show a popup window whenever user clicks the button.The popup window contains one text box and submit button for getting the filepath from the user.
for example : i want a popup like this in stackoverflow site...
Please hele me to get this...
Share Improve this question asked Jun 8, 2012 at 7:24 SaravananSaravanan 11.6k46 gold badges147 silver badges213 bronze badges 1- 1 The "popup window" is just a div with an absolute position. Look at modal windows on google. – Florian Margaine Commented Jun 8, 2012 at 7:31
2 Answers
Reset to default 4Here is a EDITED:demo.Customize it to suit your needs.Let me know if need further help. I have added a link which will display the popup on click. After that the popup div is the actual popup , the popup div contains another div , just to hold the contents , in this case textbox and buttons.Here is the Html part.
<a id="popuplink" href="#">Click Me</a>
<div id="popup">
<div id="content">
<input type="text"/><input type="Button" value="Browse..."/>
<input id="popupclose" type="Button" value="Close"/>
</div>
</div>
Here is CSS:
#popup
{
display:none;
position:fixed;
width:250px;
height: 150px;
top: 50%;
left: 50%;
margin-left:-155px;
margin-top:-110px;
border:5px solid red;
background-color:#DEDFDE;
padding:30px;
z-index:102;
font-family:Verdana;
font-size:10pt;
border-radius:10px;
-webkit-border-radius:20px;
-moz-border-radius:20px;
font-weight:bold;
}
#content
{
height:auto;
width:250px;
margin:60px auto;
}
#popupclose
{
margin:35px 0 0 80px;
width:50px;
}
EDIT: To get the value of the textbox check This demo
To call the javascript function on click of Asp.Net Button , try doing something like this. Create a function which will show the popup.
function ShowPopUp()
{
$('#popup').show("slow");
}
And on button click try this,
ClientScript.RegisterStartupScript(GetType(), "popup", "ShowPopUp()", true);
Additional Information MSDN
If I understand you correctly you want to use window.open
, here's some info: https://developer.mozilla/en/DOM/window.open
Do you need something like this (this is a crude example as I don"t know the name of your page, etc, etc...):
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function open_win() {
window.open("mypage.html");
}
</script>
</head>
<body>
<form>
<input type="button" value="Open Window" onclick="open_win()">
</form>
</body>
</html>
However I'd advise doing this in an unobtrusive manner.
本文标签: htmlHow to show a popup with textbox and browse button in javascriptStack Overflow
版权声明:本文标题:html - How to show a popup with textbox and browse button in javascript? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741274747a2369663.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论