|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Automatic submit on page load
I have the following code used in a iFrame page which passes on info from a Form on another page(called page 1) to the page (called page 2)within the iFrame page. So, when info is submitted from page 1 via that Form the info is used to display results in page 2.
This is in iFrame page. Code:
<SCRIPT LANGUAGE="JavaScript">
function fnSubmit() {
window.document.form2.submit();
return;
}
</SCRIPT>
</head>
<body LANGUAGE="javascript" onload="return fnSubmit()">
then a form with hidden inputs in the body
The trouble is that is quite slow and the page 2 first says no results as it loads, then displays the results after. Is there a way to send the info to page 2 before it loads and thus has more of a smooth operation. Thanks in advance to colton22! ![]() |
|
#2
|
||||
|
||||
|
Acutally there are several ways to do that something like that...
if you wanted to you could go ahead and have to div tags in your pages, like this... <DIV ID="page1"></DIV> --IF I understand you correctly, the iframe is in this div <DIV ID="page2" STYLE="display:none"></DIV> --Whatever DOESNT change have already in here when the form submits, what ever you want done to the page2 all you have to do is the following code... function changePages() { page2.innerHTML="all the page in one string"; page2.innerHTML+="More if you want"; window.document.all.page1.style.display="none"; window.document.all.page2.style.display="inline"; } therefore it will switch pages without re-contacting the server, and you will still get an "updated" page out of it. or you could use php and post it, thats harder though, i would recommend posting a thread in there if you wanna do that next option... a good one that not many know about... there is a thing in js --> location.search what it does is take everything after the .html or .htm i have an example of this at... http://www.freewebs.com/colton22/track.html?error if you wanted to you could set this up to set the textfield values up in a line of string, seperated by special charaters and different symbols, then go to this site... window.document.location.href=window.document.loca tion+"?"+extrastrings if you need more help contact me at Colton22@comcast.net i hope i was of some help colton22 - http://www.freewebs.com/colton22 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Automatic submit on page load |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|