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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reset two forms on one page 1

Status
Not open for further replies.

smurf01

IS-IT--Management
Jul 6, 2002
470
GB
Hi,
I have a page that contains two forms that each contain a combobox I ahve added the following code so that the form is reset when the back button is used however only the first form resets couls someone provide me with the correct syntax to make both forms reset.

<body onLoad=&quot;frmACOut.reset; =&quot;frmACcom.reset()&quot;>

Regards

Paul
 
how about naming both form the same name?

Many .asp question and answers are now in downloadable pdf format and can be found here: thread333-721855
 
If I name both of the forms the same then neither of them work.

Any other ideas would be appreciated

Regards

Paul
 
Try this

<body onLoad=&quot;JavaScript:frmACOut.reset();frmACcom.reset()&quot;>

Cheech

[Peace][Pipe]
 
Cheech,
Tried that It did not work

Regards

Paul
 
Cheech,
To be more precise what I should have said was that it does not work on either form

Regards

Paul
 
Cheech,
Sorted, I just put a space after the semi-colon and it worked
Code:
<body onLoad=&quot;JavaScript:frmACOut.reset() ;frmACcom.reset()&quot;>

As always you come to my rescue, i think a &quot;STAR&quot; is deserved

:-D [2thumbsup] :-D

Regards

Paul
 
Sorry just read your post fully &quot;back&quot; means you are not triggering the onLoad event again just from cache so you need to clear the cache. Stick this in the head of your document
Code:
<%
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader &quot;pragma&quot;,&quot;no-cache&quot;
Response.AddHeader &quot;cache-control&quot;,&quot;private&quot;
Response.CacheControl = &quot;no-cache&quot;
%>

Cheech

[Peace][Pipe]
 
Cheech,

Put the code into the header as suggested, when I opened the page it came back with this error message

Response object error 'ASP 0156 : 80004005'

Header Error

/estimating/EFACSearch.asp, line 20

The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content


Regards

Paul
 
Cheech,
It's the first line of your code

Response.Expires = 60

Regards

Paul
 
I think that is has to be at the very top of the header code. Try moving it to the second line, just after the <%@LANGUAGE=&quot;VBSCRIPT&quot;%> declaration

[Peace][Pipe]
 
Cheech,
Spot on as usual
Thanks for the Help

:-D [2thumbsup] :-D

Regards

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top