• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 557
  • Last Modified:

How can I add a scroll Bar using showModalDialog

I use showModalDialog to open a htm word document where the image is clicked.
The problemis showModalDialog does not add a scroll Bar to move to rigth and up and down, it causes the problem

See the following syntax I used.

showModalDialog(DialogueFile,"","center=yes;dialogWidth=600pt;dialogHeight=400pt");


Please advise how to add a scroll bars to the DialogueWindow

Thankyou in advance
0
LeanMoreTryMore
Asked:
LeanMoreTryMore
  • 6
  • 5
  • 2
1 Solution
 
hongjunCommented:
Try this

showModalDialog(DialogueFile,"","center:yes;dialogWidth:600pt;dialogHeight:400pt;scroll:yes");
0
 
LeanMoreTryMoreAuthor Commented:
I DONT KNOW WHY IT DOES NOT WORK. It does NOT APPEAR THE SCROLL BAR even I specify the scroll=YES. I check the syntax that is correct as the showModalDialog is run from within the script. See code below



function OpenDialogue(iDialogueFile) {
  if (window.showModalDialog) {
    var sRtn;
    var DialogueFile = "Doc/" + iDialogueFile;
    sRtn = showModalDialog(DialogueFile,"","center=yes;dialogWidth=600pt;dialogHeight=400pt;scroll=yes");

 }


==========
PLEASE ADVISE
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
hongjunCommented:
BTW, there seems to have a short of 1 closing bracket } for the if.

hongjun
0
 
LeanMoreTryMoreAuthor Commented:
JUST CUT AND PLASTE PROBLEM.

function OpenDialogue(iDialogueFile) {
  if (window.showModalDialog) {
    var sRtn;
      var DialogueFile = "Doc/" + iDialogueFile;
    sRtn = showModalDialog(DialogueFile,"","center=yes;dialogWidth=600pt;dialogHeight=400pt;scroll=yes");

    if (sRtn!="")
      elTarget.value = sRtn;
  } else
    alert("Internet Explorer 4.0 or later is required.")
 }
0
 
hongjunCommented:
See if this work.


<script language="JavaScript">
<!--
function OpenDialogue(iDialogueFile) {
  if (window.showModalDialog) {
    var sRtn;
//    var DialogueFile = "Doc/" + iDialogueFile;
    var DialogueFile = "http://www.sg";
    sRtn = showModalDialog(DialogueFile,"","center=yes;dialogWidth=200pt;dialogHeight=400pt;scroll=yes;");
  }
}

OpenDialogue("");
//-->
</script>



hongjun
0
 
LeanMoreTryMoreAuthor Commented:
yes. it works for your sample as DialogueFile is a web site.

But my dialogue file is a htm file.
Such as CompanyPolicy.htm

0
 
hongjunCommented:
ok.. I created a .html file named try.html with contents like this

<pre>
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try
This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try This is a try

</pre>


With the below javascript code, it shows both horizontal and vertical scrollbars as expected :)
<script language="JavaScript">
<!--
function OpenDialogue(iDialogueFile) {
  if (window.showModalDialog) {
    var sRtn;
//    var DialogueFile = "Doc/" + iDialogueFile;
    var DialogueFile = "try.html";
    sRtn = showModalDialog(DialogueFile,"","center=yes;dialogWidth=200pt;dialogHeight=400pt;scroll=yes;");
  }
}

OpenDialogue("");
//-->
</script>



Perhaps as for your case, you would like to do a alert on the content of DialogueFile like this
    alert(DialogueFile);


Cheers
hongjun
0
 
LeanMoreTryMoreAuthor Commented:
USE alert DOES not open the htm file.
just display the text "try.html"
0
 
hongjunCommented:
yes :)
The whole idea is to check if the DialogueFile is correct.
Is the path displayed correctly for your case?


hongjun
0
 
deighcCommented:
This is an inherent limitation of modal dialogs. They're designed to behave this way.

There are two workarounds for this:

1. Use a scrolling <div>
2. Make your modal dialog 'root' document an <iframe> then load the page you want to display into the IFRAME (incidentally, this is what you MUST do if you want to link to different pages within an modal dialog).
0
 
LeanMoreTryMoreAuthor Commented:
Hi deighc,

Please give me the sample code. I'm not sure very how to do it.

See my code below
function OpenDialogue(iDialogueFile) {
  if (window.showModalDialog) {
    var sRtn;
     var DialogueFile = "Doc/" + iDialogueFile;
    sRtn = showModalDialog(DialogueFile,"","center=yes;dialogWidth=600pt;dialogHeight=400pt;scroll=yes");

    if (sRtn!="")
      elTarget.value = sRtn;
  } else
    alert("Internet Explorer 4.0 or later is required.")
 }



I have increased the point to 500 as I can see the difficulties
0
 
deighcCommented:
Unless you need to navigate within the IFRAME I would try a scrolling <div> first.

<div style="height: 100%; overflow: auto;">
    <!-- Content here. Container will automatically add scroll bars if necessary -->
</div>
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

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