I've attached onsubmit handler in a form tag like this:
<form action="file.php" method="post" onsubmit=" return get_prepared_build(this);" >
but whatever global variable (defined earlier, of course) I try to change inside get_prepared_build() function - later it apprears non-modified. Looks like that this function deals with a local copy of everything, even document property values are not saved.
Are there scope/visibility problems when javascript functions are called this way from tags/attributes?
Here is the function:
function give_link(results)
{
document.title = 'visibility test';
return false;
}
then below in the document I have
<script>alert('test' + document.title );</script>
As a result - in the window I have a new title, but the alert box displays old variable value.