Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Dear friends please help in finding solution for this issue.

I need to show popupwindow with combobox in it and ones if i select some value in the combobox and press the button then it should show another alert message using javascript or ajax.

ex : http://attachments.techguy.org/attachments/92897d1164709788/pm_combo.jpg[^]
Posted
Comments
kiran dangar 20-Oct-11 5:00am    
Hi, Do not post your reply as Solution.. rather post same thing in as comment by clicking "Have a Question or Comment?" link...
Your reply will be deleted, pls post reply in comment.

1 solution

Hi, you can not use Alert to show and control inside that...

However you can use any Javascript/JQuery model popup plug-in instead and put your drop down inside popup..

I have implemented a jquery model popup plug-in which can be useful to you..

Read this article : Implementing J-Query Model Popup Plug-In and Playing FLV file in a model popup[^]


In the article there is a jQuery plugin called model-popup.js.. you can use it as shown below..

step 1 : Reference Popup plug-in

XML
<script type="text/javascript" language="javascript" src="resource/jquery-1.2.6.min.js"></script>

<script type="text/javascript" language="javascript" src="resource/model-popup.js"></script>


Step 2: Create Popup container

XML
<a id="YourButton">Click Here to open model popup</a>

<div class="popupDiv">
<div>
<asp:DropDownList id="DropDownList1" runat="server">
   <asp:ListItem value="value" >Text</asp:ListItem>
</asp:DropDownList>
</div>
<div class="close">
<a class="lnkOk">OK</a></div>
</div>


Step 3: Call Popup Plug-In

JavaScript
$(document).ready(function()
               {   
               $("#YourButton").click(function()
                   {
                      $("div.popupDiv").Init(
                       {
                           closeButtonCSS:"lnkOk"
                       }); 
                   });
               });



Step 4: Show Alert when clicking on Ok Button of Popup

JavaScript
$(document).ready(function()
               {   
               $("#YourButton").click(function()
                   {
                      $("div.popupDiv").Init(
                       {
                           closeButtonCSS:"lnkOk"
                       }); 
                   });

                $("lnkOk").click(function()
                {
                    alert("Your message goes here!");
                });
                
               });


Hope this will help...


[Please click "Accept Answer" if this helps you out ]
 
Share this answer
 
v5

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