function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
saimadhusaimadhu 

how to open a jquery modal window

Hi,

 

In my visualforce page i have couple of buttons.

if I click a button then  it should open a jquery modal window and this modal window displays a dropdown list.

how can i do this.iam new to jquery .

 

 

mast0rmast0r

Try this one out:

 

<script>
jQuery(document).ready(function(){
    jQuery(function() {
        jQuery("#myModal").dialog({
            resizable: true,
            autoOpen: false,
            height:150,
            width: 400,
            modal: true,
            buttons: {
                "Save": function() {
                    // Call here your actionFunction
                },
                Cancel: function() {
                    jQuery( this ).dialog( "close" );
                }
            }
        });
    });
});
</script>
	
<apex:commandButton id="opener" 
		    onclick="jQuery('#myModal').dialog('open'); return false;" 
		    value="Open modal window"
		    reRender="none"/>
					
<div id="myModal">
    <p>Hi, i am a modal window :) Your content comes here.</p>
</div>