gives message form.submit is not function

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
rajan
Forum Contributor
Posts: 110
Joined: Sun Aug 28, 2005 7:42 pm
Location: Lucknow, UP, India

gives message form.submit is not function

Post by rajan »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


i can't understand what is the problem the code given below . when i submit the form it gives message document.form.submit() is not function
checkadmin and userendpage is just a html include file and validate js file is javascript function library

Code: Select all

<? 
//include_once("includes/dbconnect.php");
include_once("includes/functions.lib.php");

//include_once("includes/pagination/my_pagina_class.php"); 
checkAdmin();
?><head>
<script languaage="javascript" src="includes/validate.js"></script>
<script languaage="javascript" >
function check()
{
a=document.form;
	var msg="";
	
	msg+=checkpassword("Password",a.password1.value);
		 if(msg!="")
	 	alert(msg);
	else
		a.submit();
}
</script>
</head>
<?
userStartPage();
?>
<?
if(isset($_POST['submit']))
{
echo "hello";
}
?>


<form name="form" method="post">
<table >
<tr>
<td>
Enter The New Password
</td>
<td>
<input type="password" name="password1">
</td>
</tr>
<tr><td>Enter the Verify Password</td><td><input type="password" name="password2"></td></tr>
<tr>
 <td align="right"><input name="submit" type="button" value="submit" onClick="check()">&nbsp;</td>
 <td>&nbsp;</td>
</tr>
</table>
</form>
<a href="logout.php">Logout</a>
</body>
</html>
<?php // $test->free_page_result(); // if your result set is large then free the result here ?>  

<? userEndPage(); ?>

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
neel_basu
Forum Contributor
Posts: 454
Joined: Wed Dec 06, 2006 9:33 am
Location: Picnic Garden, Kolkata, India

Post by neel_basu »

rajan wrote:<?php // $test->free_page_result(); // if your result set is large then free the result here ?>
You Have Not Closed ?> Its being Ignored For The //
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

your submit button is also named submit. change the name of the button and it'll work.
Post Reply