There is an iframe in my document that is hidden, which is the target for a
submitted form. When the form is submitted, some javascript sets a hidden
div, to displaying, eg:
document.getElementById('hiddendiv').style.display = '';
This div, simply has the words "building csv file, please wait", and is
used, because their is no indication in IE, as to what is happening, when
the user clicks on 'Results in CSV format', to return a report as a CSV
file.
The form is submitted to the hidden iframe. The asp page that is used in the
action of the form (run.csv.report.asp), has a content type of
"text/comma-separated-values" and a response header of
""Content-Disposition","filename=report.csv".
If the report returns no records, in the asp page, I can return either;
<html>
<body onload="
window.top.document.getElementById('hiddendiv').st yle.display='none';
alert('No records have been found for your report');"></body></html>
Or if the number of records is greater than 65535 (maximum number of rows
Excel can handle);
<html>
<body onload="
window.top.document.getElementById('hiddendiv').st yle.display='none';
alert('Too many records for Excel.\nPlease refine your search
criteria'');"></body></html>
However, if records are found, because the response is a csv, (ie:
response.write "field1,field2,field3" & vbCrLf) I can not use the javascript
of;
window.top.document.getElementById('hiddendiv').st yle.display='none';
Otherwise, this line is included in the csv file and the div is not hidden
when the report is finished.
Is there anyway to hide the div on the client, after the server has created
the report? 2 2085
I am not 100% sure that this will work in all browsers, but you can query the
elements 'readyState' in a loop or something similar, I have made a quick
example to show:
(quick and dirty, i know)
<html>
<head>
<script language="javascript">
var timer
function xcheckStatus() {
timer = setTimeout('loopstatus()',20)
}
function loopstatus() {
clearTimeout(timer)
window.status = document.getElementById("myiframe").readyState
timer = setTimeout('loopstatus()',20)
}
</script>
</head>
<body onload="xcheckStatus()">
<input type="text" name="bob" id="myurl"><input type="button" name="btn"
value="go" onclick="document.getElementById('myiframe').src =
document.getElementById('myurl').value">
<iframe id="myiframe" src="testeriframe.asp" ></iframe>
</body>
</html>
When the readyState comes back as completed, it is done. However I did not
test this using an csv file, just html pages.
"Ruskin Hardie" wrote: There is an iframe in my document that is hidden, which is the target for a submitted form. When the form is submitted, some javascript sets a hidden div, to displaying, eg:
document.getElementById('hiddendiv').style.display = '';
This div, simply has the words "building csv file, please wait", and is used, because their is no indication in IE, as to what is happening, when the user clicks on 'Results in CSV format', to return a report as a CSV file.
The form is submitted to the hidden iframe. The asp page that is used in the action of the form (run.csv.report.asp), has a content type of "text/comma-separated-values" and a response header of ""Content-Disposition","filename=report.csv".
If the report returns no records, in the asp page, I can return either; <html> <body onload=" window.top.document.getElementById('hiddendiv').st yle.display='none'; alert('No records have been found for your report');"></body></html>
Or if the number of records is greater than 65535 (maximum number of rows Excel can handle); <html> <body onload=" window.top.document.getElementById('hiddendiv').st yle.display='none'; alert('Too many records for Excel.\nPlease refine your search criteria'');"></body></html>
However, if records are found, because the response is a csv, (ie: response.write "field1,field2,field3" & vbCrLf) I can not use the javascript of;
window.top.document.getElementById('hiddendiv').st yle.display='none';
Otherwise, this line is included in the csv file and the div is not hidden when the report is finished.
Is there anyway to hide the div on the client, after the server has created the report?
You have sparked my curiosity!!!
In further testing (and optimized codeing) I have discovered that you will
get back 'interactive' as the last readyState due to the save / open / cancel
dialog.
<html>
<head>
<script language="javascript" for="myiframe" event="onreadystatechange()">
document.getElementById("mytextarea").value =
document.getElementById("myiframe").readyState + "\n" +
document.getElementById("mytextarea").value
</script>
</head>
<body>
<input type="text" name="bob" id="myurl" />
<input type="button" name="btn" value="go"
onclick="document.getElementById('myiframe').src =
document.getElementById('myurl').value" />
<br />
<iframe id="myiframe" src="testeriframe.asp" ></iframe>
<br />
<textarea id="mytextarea" rows=10></textarea>
</body>
</html>
"Ruskin Hardie" wrote: There is an iframe in my document that is hidden, which is the target for a submitted form. When the form is submitted, some javascript sets a hidden div, to displaying, eg:
document.getElementById('hiddendiv').style.display = '';
This div, simply has the words "building csv file, please wait", and is used, because their is no indication in IE, as to what is happening, when the user clicks on 'Results in CSV format', to return a report as a CSV file.
The form is submitted to the hidden iframe. The asp page that is used in the action of the form (run.csv.report.asp), has a content type of "text/comma-separated-values" and a response header of ""Content-Disposition","filename=report.csv".
If the report returns no records, in the asp page, I can return either; <html> <body onload=" window.top.document.getElementById('hiddendiv').st yle.display='none'; alert('No records have been found for your report');"></body></html>
Or if the number of records is greater than 65535 (maximum number of rows Excel can handle); <html> <body onload=" window.top.document.getElementById('hiddendiv').st yle.display='none'; alert('Too many records for Excel.\nPlease refine your search criteria'');"></body></html>
However, if records are found, because the response is a csv, (ie: response.write "field1,field2,field3" & vbCrLf) I can not use the javascript of;
window.top.document.getElementById('hiddendiv').st yle.display='none';
Otherwise, this line is included in the csv file and the div is not hidden when the report is finished.
Is there anyway to hide the div on the client, after the server has created the report? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Mikko Ohtamaa |
last post by:
From XML specification:
The
representation of an empty element is either a start-tag immediately
followed by an end-tag, or an empty-element tag.
(This means that <foo></foo> is equal to...
|
by: Philo |
last post by:
How do I select all <div> tags except those which contain a <table> tag
somewhere within them?
Example XML:
<********************** sample input ***********************>
<txtSectionBody>...
|
by: Toby Austin |
last post by:
I'm trying to replace <table>s with <div>s as much as possible.
However, I can't figure out how to do the following…
<table>
<tr>
<td valign="top" width="100%">some data that will...
|
by: alexrib |
last post by:
Hi,
I have a web application which uses external CSS files extensively.
Now, I need to port this application to run inside a portlet. So, it
will not generate a complete HTML document, but just...
|
by: Rodney Dunning |
last post by:
Forgive me if this is a stupid question. I have a course syllabus
located at
http://www.longwood.edu/staff/dunningrb/teaching/easc101f06/easc101f06_syllabus.html.
I use a <divcontainer for...
|
by: vidyasada |
last post by:
Hi
i m new to javascript . i need a script to srcoll the <div> content vertically within the <div> and it stops few seconds at the end of the content ..
and again starts scrolling.. please...
|
by: Summercoolness |
last post by:
so i am starting to use more of <br /and <div style="clear: both" /
which is the XHTML style...
now, won't those actually confuse the old browsers? for example,
will the old browser treat the...
|
by: obwatter |
last post by:
i'm trying to recreate what i *think* should be a simple CSS/JS <div> content reveal / swap.
just like this one ("A Tale of Two Pets", near bottom of page):
...
|
by: prino |
last post by:
Hi all,
I've written code (in REXX) that takes files in legacy languages (PL/I, COBOL, z/OS assembler, etc) and converts them into HTML in a format similar to what's displayed in the z/OS ISPF...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |