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

problem with event handlers and include file - Please Help!

Status
Not open for further replies.

frogggg

Programmer
Jan 17, 2002
182
US
I have an include.asp file on every page. My problem is that on any page that requires server side event handlers such as onClick, there seems to be another round trip to the server which cancels out the contents of the page. For example, the code in the handler will not recognize the form values on the page or the recordsets on the page causing lines of code such as:
session("Location") = Request.Form.Item("lstLocation")
to come up blank
or:
rsDisplayDetails.fields.getValue("EmployerID")
to come up rsDisplayDetails 'object required'.

Does anyone know what I can do to get around this problem - it's pretty urgent, and if I can't get it working soon my boss will have me do away with VI (which may not be such a bad thing in principle but I'm not too prepared to rewrite nearly all my code) just to get rid of the object model which he thinks is causing all this trouble.

Thanks for your help.
 
Are you "posting" this to the server?
Usually, you use an HTTP GET or HTTP POST.
If you expect the data to be shown in the request object as your code indicates above, you need to issue a POST.

Also research the use of "hidden fields" if you are "posting" an asp page back to itself.

By that I mean, if you are expecting the user to click on a button and the same asp page to return to the client browser only with the input form fields "filled in".


Gilbert M. Vanegas
Programmer Analyst III
County of San Bernardino - ISD
Email : gvanegas@isd.sbcounty.gov
 
It sounds like you have a second form on the page. Get rid of this second form (perhaps its in the include file).

Browse the page and do a view source. How many <form...> tags are there? There should only be one (name=thisForm).

The reason that your fields are blank is that the second form is being submitted - and only the form fields contained within that form will be sent to the server.

Hope this helps. (Content Management)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top