?
Solved

How can I add a scroll Bar using showModalDialog

Posted on 2005-05-02
13
Medium Priority
?
551 Views
Last Modified: 2012-06-27
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
Comment
Question by:LeanMoreTryMore
  • 6
  • 5
  • 2
13 Comments
 
LVL 33

Expert Comment

by:hongjun
ID: 13915483
Try this

showModalDialog(DialogueFile,"","center:yes;dialogWidth:600pt;dialogHeight:400pt;scroll:yes");
0
 

Author Comment

by:LeanMoreTryMore
ID: 13915537
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 33

Expert Comment

by:hongjun
ID: 13915550
BTW, there seems to have a short of 1 closing bracket } for the if.

hongjun
0
 

Author Comment

by:LeanMoreTryMore
ID: 13915555
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
 
LVL 33

Expert Comment

by:hongjun
ID: 13915557
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
 

Author Comment

by:LeanMoreTryMore
ID: 13915577
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
 
LVL 33

Expert Comment

by:hongjun
ID: 13915593
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
 

Author Comment

by:LeanMoreTryMore
ID: 13915616
USE alert DOES not open the htm file.
just display the text "try.html"
0
 
LVL 33

Expert Comment

by:hongjun
ID: 13915625
yes :)
The whole idea is to check if the DialogueFile is correct.
Is the path displayed correctly for your case?


hongjun
0
 
LVL 15

Expert Comment

by:deighc
ID: 13917542
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
 

Author Comment

by:LeanMoreTryMore
ID: 13922499
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
 
LVL 15

Accepted Solution

by:
deighc earned 2000 total points
ID: 13924741
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month17 days, 9 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question