Hi Everyone,

I have a little problem which is bugging me.

I am building a site which works with Smarty and many PHP include files. I'm using many Javascript functions all over the site for validating forms, etc...

So I have a "header.php" file with the following :

HTML Code:
<script language="javascript" type="text/javascript" src="js/validations.js"></script>
...and then I have another Smarty template file named "edit_account_pers.tpl" with the following line of code :

HTML Code:
<form name="edit_pers" onsubmit="return validateeditpers()" action="{$domain}/{$edit_account_process}" method="post">
I'm assuming that the Smarty doesn't have anything to do with this, but it simply doesn't work. I have many other validation functions in that same "validations.js" file that work perfectly fine on other forms on the site.

Here is the function for this specific form :

HTML Code:
function validateeditpers()  {  	valid = true;  	  	if (document.edit_pers.fname.value == "")  	{  		alert ("Please fill in your first name!");  		valid = false;  		document.edit_pers.fname.focus();  		return valid;  	}  	  	if (document.edit_pers.lname.value == "")  	{  		alert ("Please fill in your last name!");  		valid = false;  		document.edit_pers.lname.focus();  		return valid;  	}  	  	return valid;  }
I'm getting frustrated, since I need it to work.
Does anyone have an idea why this doesn't work? It's so simple, and my other validation functions work on the same principle. Maybe I'm missing something here...

Thanks for any advice.

All the best,