...

View Full Version : form problem



eranwein
01-30-2006, 02:08 AM
this is a code i wrote just to check something that didnt seem to work in my site.

when i press on the button i get an error: "object doesnt support this property or method".

i've checked it without the form and it worked. but when i place the button inside the form it doesnt. i've tried to switch between get and post and other things but i'm probably missing something.

<script>

function aaa(num)
{
alert(num);
}

</script>


<form name = "form1" action="" method="post">
<input type="button" name="aaa" value="press" onClick="aaa('3')" />
</form>

glenngv
01-30-2006, 02:31 AM
It seems like it doesn't like the method name aaa. I changed it to bbb (or even to aa or aaaa) and it worked. I don't know if aaa is a reserved word or not. It doesn't look like one but changing it worked.

eranwein
01-30-2006, 02:44 AM
i dont belive it... i was about two murder my computer.
thanks for saving it (and me) ;)

liorean
01-30-2006, 10:23 AM
The problem is that you use the same name for the control as the function. Some browsers in some modes place element names as variable names in the global scope, thus overwriting functions and variables with the same names.

glenngv
01-31-2006, 02:55 AM
Oopps, I didn't notice the button name was "aaa". How did I miss that. :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum