File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes how to add a scroll bar on alert box to display extremely long message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how to add a scroll bar on alert box to display extremely long message" Watch "how to add a scroll bar on alert box to display extremely long message" New topic
Author

how to add a scroll bar on alert box to display extremely long message

white lily
Greenhorn

Joined: Oct 14, 2001
Posts: 10
Hi, there
I need to display lots of data on an alert box but I found I have no way to scroll it down in order to look at the latter half part. I am wondering if there is anyone has similiar experience and any solutions.
Thanks in advance.
Lily
Dale DeMott
Ranch Hand

Joined: Nov 02, 2000
Posts: 515
You might be better off just opening a window and you controlling the size of the window.
Dale
------------------
By failing to prepare, you are preparing to fail.
Benjamin Franklin (1706 - 1790)


By failing to prepare, you are preparing to fail.<br />Benjamin Franklin (1706 - 1790)
white lily
Greenhorn

Joined: Oct 14, 2001
Posts: 10
The messge is dynamicly obtained during run-time therefore, I can not create html file for it. Can I use JSP page instead of html file ?
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4339
    
    2

yes perfect use for jsp. i dont know jsp that well but i used it in my web app to give me dynamic html i only had one line of java which was to get the user name from the request. thats what i would do is use .jsp instead of .html
as long as your server supports that.
[This message has been edited by Randall Twede (edited October 22, 2001).]


SCJP
Visit my download page
white lily
Greenhorn

Joined: Oct 14, 2001
Posts: 10
Thanks, Dale and Randall.

I passed the long data to a hidden field and then used a javascript to open a new window to display the data. It was successful but the format of the data is a total mess. It was extremely tidy and clean when I used alert box, though. I believe that using jsp file would result in the same result.
Anybody knows why alert box is able to do this and how we can get the same thing done using window object or any other ways?
Lily
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4339
    
    2

maybe an applet then. i think the problem sounds like with alert box you get auto(linefeeds thrown in maybe)? in an applet you can use a ?(i forget its been a long time) which will do what you want. Im not sure but thats where i would look next.
actually with jsp you can use any java objext so you should be able to do it in jsp. better than applet maybe.
------------------
Dont blindly believe everything I say.
[This message has been edited by Randall Twede (edited October 23, 2001).]
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4339
    
    2

white lily,
I hate to say this but, your name does not comply with the Javaranch naming guidelines which can be found at http://www.javaranch.com/name.jsp
please register again with a valid name.
they like real or real sounding names.
white lily
Greenhorn

Joined: Oct 14, 2001
Posts: 10
I am sorry. I will do it next time I post a topic.
Lily
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4339
    
    2

im still waiting to see if anyone has a good answer for you. i feel so useless sometimes
A1ien51 CNEUFOs
Greenhorn

Joined: Nov 05, 2001
Posts: 16
You can write the code directly to the pop up window. It is rather easy to do. All You need to do is updat the variable SayWhat with the text you want it to say. If you need help adapting this code, just hollar.
<html>
<head>
<title>PopUpScript</title>
<script>
function PopUp(){
var ScreenWidth=window.screen.width;
var ScreenHeight=window.screen.height;
var movefromedge=0;
placementx=(ScreenWidth/2)-((400)/2);
placementy=(ScreenHeight/2)-((300+50)/2);
WinPop=window.open("About:Blank","","width=400,height=300,toolbar=0,location=0,directories=0,status=0,scrollbars=0,menubar=0,resizable=0,left="+placementx+",top="+placementy+",scre enX="+placementx+",screenY="+placementy+",");
var SayWhat = "<p><font color='blue'>This is what the windows text is</font></p>";
WinPop.document.write('<html>\n<head>\n</head>\n<body>'+SayWhat+'</body></html>');
}
</script>
</head>
<body>
<a href="javascript:PopUp()">Type One</a>
</body>
</html>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to add a scroll bar on alert box to display extremely long message
 
Similar Threads
Alert
form validation
Display a Session Attribute
Javascript: Alert Box with Yes/No Button
How to create a customised alert box using javascript