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

html-javascript problem 1

Status
Not open for further replies.

daveask

Programmer
Aug 11, 2004
108
GB
Hi,

Can you tell me why this simple code not works?

<SCRIPT language='javascript'>
<!--
function Test()
{
//do something
window.location.href='}
//-->
</SCRIPT>

<Form onsubmit="return(Test())">
<input type="submit">
</Form>
 
Because form submit wasn't cancelled. Add return false; at the end of script... or don't use form submit for redirect at all.
 
maybe its :
<Form onsubmit="return Test()">


Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top