Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi I was trying to display confirmation box I have created the below code and when I click ok and cancel buttons it should close the popup window but form me its not closing. can anyone help me to solve. Below is the html code and one more thing if I use javascript it shows error "$" is undefined can anyone help me to use anyother option to solve.

ASP.NET
<div class="box">
	<a class="button" href="#popup1">Upload Document</a>
</div>

<div id="popup1" class="overlay">
	<div class="popup">
		<h2>Upload Document</h2>
		<a class="close" href="#">×</a>
		<div class="content">
			<form action="" method="post" enctype="multipart/form-data" name="form" id="form1">
<label>Choose File 
<input type="file" multiple="true" style="width: 315px" />
                <br />
                <br />
                Destination Folder
<input type="file" multiple="true" style="width: 317px" />
                <br />
                <br />
                <br />

</label>
</form>
		    <asp:Button ID="btnOk" runat="server" Text="OK"
            <asp:Button ID="btnCancel" runat="server" Text="Cancel" />
		</div>


The above code I tried its displaying correctly if I click Ok after uploading the file is not uploading and click cancel also no change can anyone suggest me to do. And one more thing instead of file upload do we have option like Choose folder because for destination folder I have to create button name choose folder.
Posted
Updated 28-Dec-15 19:10pm
v2

1 solution

There are many ways you can handle it but simple is below one
JavaScript
//just call a function on button click and return true of user click on OK
function confirmSubmit() {
      var agree=confirm("Are You Sure you want to Delete?");
      if (agree)
       return true ;
      else
       return false ;
    }

//in aspx
<asp:button id="btnDel" runat="server" text="DELETE" onclientclick="confirmSubmit()" xmlns:asp="#unknown" />
 
Share this answer
 
Comments
Member 12233287 29-Dec-15 1:41am    
Hi I don't want separate popup window after uploading documents in popup box then click ok the uploaded documents should display in parents page after upload document button. now after uploading documents If i click ok documents not uploading
koolprasad2003 29-Dec-15 1:50am    
After click on OK button is your server event gets fired or not ?
Member 12233287 29-Dec-15 2:11am    
after I click ok again I got popup window I don't want that my aim is if I click ok the files uploaded should display
koolprasad2003 29-Dec-15 2:19am    
After click on OK you can use some hidden fields and set some flag there, so when you click on OK check for the flag and you can decide whether to shoe popup or not
Member 12233287 29-Dec-15 2:25am    
can you please help me to do that because I am very new to this subject

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900