Wrox Home  
Search P2P Archive for: Go

  Return to Index  

interdev_programming thread: 'thisPage' is undefined


Message #1 by xvoyager@h... on Mon, 14 May 2001 16:32:43
Greetings,

InterDev and IE are working together to help you debug client-side 
javascript.... what you're experiencing is not actually related to ASP.

Instead of :
   "thisPage._location='/the/file/path.asp'"
use:
  "document.location.href='/the/file/path.asp';"

I'm surprised that the the target asp page is capturing the form data when 
you choose 'no' to the debug question; you're not actually submitting the 
form data to the target asp page with your current approach. 

Unless you're trying to perform a client-side form validation, you might 
consider avoiding the use of a button with the location parameter.... 
Instead, simply use an html Submit element (type=submit instead of 
type=button) and let the form's action attribute define the target page.

<form action="/the/file/path.asp" method=post>

   <input type=submit name=cmd1 value="click here">
</form>

If you are looking to do field validation, the traditional approach is to 
capture the form's onSubmit event and call a javascript function to test 
the values in the form.  Then you call the submit method from within the 
function.  

I recommend the O'reilly JavaScript book if you really have a thirst for 
knowledge on the subject of client-side javascript.

Cheers,
jim@m...


> Hi there,
> 
> After I published all my forms onto the IIS server.  I ran one of my 
page 
> to change my password (chgpword.htm) and clicked on the submit button to 
> call (chgpword.asp) to change my data.  Interdev gave me this message 
Line 
> 1: 'thisPage' is undefined (Do you want to debug "Yes" / "No")  If I 
> clicked on "No" the data will change anyhow.  If I clicked on "Yes", 
> Interdev highlight thisPage._location = "/FO/Occur/Admin/Chgpword.asp"; 
> (read-only Javascript).  Is there a way to solve this problem?  Any help 
> or suggestion is appreciated.
> 
> Thanks

  Return to Index