View Single Post
Old 08-31-2004, 10:38 AM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,444
sde is on a distinguished road
javascript riddle: why won't my form submit from this text link?

today i ran into a problem. i've figured it out, but i wanted to post it in case anyone else didn't know or wanted to have a little fun.

so here is the question: why won't this form submit with the text link below.

mypage.html
PHP Code:
<html>
<
head>
  <
script language=javascript>
  function 
submitForm(){
    
document.myform.submit();
  }
  
</script>
</head>
<body>
<form name=myform method=post action=mypage.html>
<input type=text name=field1> <input type=submit name=submit>
</form>

<a href="javascript:submitForm()">submit this form</a>
</body>
</html> 
i'm sure someone will get it, but if not, i'll post the answer later.
__________________
Mike
sde is offline   Reply With Quote