Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1546
  • Last Modified:

jquery modal dialog.

I am using jquery modal dialog.
In the popup I need to show 400 px(width) by 200px(height) window with all the css design.
But the default size of the Jquery modal dialog is 300px only. So part of the popup is going inside the   modal dialog. I checked "jquery-ui.css" file to find out the width. But it didnt work.
It seems its getting the width dynamically.

And one more thing how to set the back ground color of the page to light gray.
I am using Visual Studio 2005 for development. How I can debug javascript in VS2005.

Any help will be highly appreciated.  
0
ken_rgr
Asked:
ken_rgr
  • 5
  • 4
1 Solution
 
Gurvinder Pal SinghCommented:
you can apply the class the modal dialog box, after the dialog box is generated.
Also width and height can applied as an option also (see the link given below)
http://jqueryui.com/demos/dialog/#option-height
http://jqueryui.com/demos/dialog/#option-width

also you can see the markup generated here
http://jqueryui.com/demos/dialog/
goto the theming tab to check the sample markup



0
 
ken_rgrAuthor Commented:
Hi Thanks for your reply.
But l already checked these links.
I didnt find any where how to set the width and height property for the modal
dialog

Thanks
0
 
Gurvinder Pal SinghCommented:
in above mentioned links, you need to check
$( ".selector" ).dialog({ height: 530 }); \\while initializing
$( ".selector" ).dialog( "option", "height", 530 ); \\setter

$( ".selector" ).dialog({ width: 530 }); \\while initializing
$( ".selector" ).dialog( "option", "width", 530 ); \\setter

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
ken_rgrAuthor Commented:
Hi

Thanks for the reply, I have figured out how to set the width and height.
But there is a problem , my div width is 350px, I set the modal dialog width as 420px.
Other wise its showing scrollbars for the modal window, which I dont want.
My question is, is it possible can we set the same width and height for the modal dialog
as like my div without the scroll bars.
I appreciate your time .

thanks
0
 
Gurvinder Pal SinghCommented:
@ken_rgr: if possible please share the sample code that you are trying and having the above mentioned problem. Thanks
0
 
ken_rgrAuthor Commented:
Hi
I fixed the width problem.
Still there is aproblem.
There are 2 checkboxes  and button on the modal dialog.
When the user checks one of the (or both) checkboxes and clicks on the button.
How the values will be passed to the page behind it.
The setVisibility() function runs when the use clicks on the Button.
I captured the values from check boxes successfully but I am not able to
pass those values to the page(lets pass it to a textbox).
I am getting the corect values from the alert boxes.
but the below line not passing the values to the page.
$("#checkbox1").value = value1;
What mistake I am doing here.

Once again thanks for your time.



<script type="text/javascript">
      function setVisibility(id, visibility) { 
      var value1,value2;
      ($("#check1").attr("checked")) ? value1 = 1 : value1 = 0;
      ($("#check2").attr("checked")) ? value2 = 2 : value2 = 0;
       $("#textbox1").value = value1;
      
      alert(value1);
      alert(value2);
       
      document.getElementById(id).style.display = visibility;
      $("#dialog").dialog("close");
      }
    </script>

Open in new window

0
 
Gurvinder Pal SinghCommented:
if you want to set the values using jquery it needs to be this way
$("#checkbox1").val(value1);
0
 
ken_rgrAuthor Commented:
Really appreciated your help and time.
It solved my problem.
Here I am accepting your solution.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now