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

Error Page

Status
Not open for further replies.

esearing

IS-IT--Management
Aug 22, 2000
132
US
I have a text box where the user inputs a value then js adds the directory and .htm extension then opens a page.

If the user inputs an invalid pagename, the standard MS "Page not found" message appears. Is there a way to jump to a customized error page? Is there an "onError" command?

...
<form name=&quot;userpage&quot;>
<p><Strong>Personal Report Pages Login:</Strong><BR>
<input type=&quot;text&quot; size=&quot;6&quot; name=&quot;PWP&quot;>
<input type=&quot;button&quot; name=&quot;submit&quot; value=&quot;Login&quot; onclick=&quot;pwpuser()&quot;>

<script language=&quot;JavaScript&quot;>
function pwpuser()
{
var PWP;
PWP = document.userpage.PWP.value
var location=(&quot;PWPAGES/&quot; + PWP + &quot;.htm&quot;);
this.location.href=location;
}
</script>
... [sig][/sig]
 
The error page pops up because the server can't find it not the javascript (so, no, there is no OnError for this as javascript has already released its hold). If you use IIS then you will need to edit your custom error pages (for error 404).

Hope this helps, [sig]<p>Rob<br><a href=mailto:robschultz@yahoo.com>robschultz@yahoo.com</a><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
"Focus on the solution to the problem,<br>
not the obstacles in the way."<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top