Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

transfer interrupted in netscape

Status
Not open for further replies.

crystalized

Programmer
Jul 10, 2000
390
CA
Hello all,

I am developing a coldfusion app within it I have a page that at one point submits to itself, completes some processing then does a javascript submit using
Code:
<script language=&quot;javascript&quot;><!--
	document.forms.ProjectAdmin.submit();
//-->
</script>
When using IE this works just fine (just a flash with the submit). The problem is in Netscape (big surprise) when it does the javascript submit the page flashes briefly with Transfer Interrupted then proceeds with the page submission.

I have tried to ensure that all html code is completed before doing the javascript submit. I am somewhat at a loss here as to how to avoid this very irritating feature in NS.

Any hints are greatly appreciated Crystal
crystalized_s@yahoo.com

--------------------------------------------------

Experience is one thing you can't get for nothing.

-Oscar Wilde

 
it's that IE has a bad timing - for once, ns is not the culprit, it behaves normally and logically !!!
what you do is
* sending the form to the server once &quot;at one point submits to itself,&quot;
* then do some stuff CLIENT SIDE &quot;completes some processing&quot;
* finally re-send the form to the server &quot;then does a javascript submit&quot;

what netscape does, is that it waits for the server's answer after the first submit - as you didn't make the server answer anything, netscape just waits and waits - until you REsubmit - then nn stops waiting and warns you that it had had to stop waiting

now i think submitting once then doing some treatment CLIENT side then resubmitting is NOT a good idea, and you should rethink your app - the design has obviously been thought in a weird way


 
The things that are done are server side processing, then I create the form with the hidden values necessary to continue the process. The fact that you assumed it was doing some client side stuff is a mistake, the only client side thing I do is the javascript submit (so that I can continue to pass values with the hidden form fields rather than using cold fusions cflocation where I would have to append the values). I am not sure if you are familiar with cold fusion but from what I have seen of cold fusion apps it seems quite common to have a page submit to itself in different &quot;modes&quot; (at least that is what I call them) and for each of the modes a different process or action is completed.

In this case the process is basically this:
Create a form on &quot;page1&quot; (for adding)
Submit the form to &quot;page1&quot; (on click of user)
Complete some server side processing (database)
Create a form on page1 with hidden fields
Submit the form to &quot;page1&quot; (automatic submission with the javascript detailed above)
Create a form showing results in another layout (for editing)
.
.
.

So as you see I do send something back to the client from the server a hidden form, which I then submit automatically. Now I could recreate the whole creation of the results page after the database processing is complete but I was trying to avoid that as there is no point in duplicating code that already exists.

I hope this helps to clarify the process I am going through and how the javascript submit is utilized. If I do not find any way around this I will probably just change it to the server side cflocation.

Any other assistance on this question would be appreciated.


Crystal
crystalized_s@yahoo.com

--------------------------------------------------

Experience is one thing you can't get for nothing.

-Oscar Wilde

 
ok, i've been developping huge apps in coldufsion and yes, at every &quot;stage&quot; of the form we where submitting to the server, processing some stuff, and then sending back to the client some values to update the form
but it was very well specified and very clear what we wanted to do - and one more point is that we were ALWAYS thinking this process as if it was submitting to a SECOND form (the all in one single form trick is only here for user's readability, but the process behind is exactly the same as if you use 2 forms - meaning, if you CAN'T think your prcess as 2 forms, you have to rethink again, as it's a sign for a design flaw)
so for example if i wanted to run a query depending on a value set in the form, and then update some other part of the form depending on this query's result, the process was :

-- the value that is required to run the query ---
<input type=text name=value_to_send <cfif is defined form.value_to_send>value=#form.value_to_send# onclick=&quot;this.blur&quot;</cfif> onchange=&quot;javascript=&quot;this.form.submit()&quot;>

- if the form has already been submitted (form.value_to_send is defined), jsut display the entered value and prevent it from changing.
- Else, if a value is entered, submit the form - we suppose it is submitted to itself

---- running the query once the form has been sent to itself ---

(this goes very first in the page)
<cfif is defined &quot;form.value_to_send&quot;>
<cfquery name=my_query ...>
....
</cfquery>
</cfif>

-------- updating the form depending on the query's results ---
(say i only want to display the results in a table - but it's exaclty the same to update a sselect box or whatever)

<cfif is defined &quot;form.value_to_send&quot;>
<table>
<cfoutput query=my_query>
<tr><td>#my_query.one_value#</td></tr>
</cfoutput>
</table>
</cfif>

--- done, and there's no transfer interupted (checked !!) --
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top