Page 1 of 1

gives message form.submit is not function

Posted: Fri Dec 08, 2006 11:42 pm
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]

Posted: Sat Dec 09, 2006 4:29 am
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 //

Posted: Sat Dec 09, 2006 8:15 am
by Burrito
your submit button is also named submit. change the name of the button and it'll work.