[thelist] changing form values in Mac IE5

Joe Crawford jcrawford at avencom.com
Tue Sep 25 11:33:43 CDT 2001


"// kerin | airside.co.uk" wrote:
> I've got a pretty straightforward bit of javascript which changes the
> value of a form field :
> 
> function changeIcon(ind){
>     if(counter<=0&&ind<0){
>        counter = imgArr.length-1;
>     }else if(counter==imgArr.length-1&&ind>0){
>        counter = 0;
>     }
>     else{
>        counter+=ind;
>     }
>     document.register.icon.value = (counter+1);
>     chngImg();
> }
> As you can see, it just assigns the value of counter+1 to form
> element 'icon'. The form is named register, and is the only one in
> the page.
> 
> It works absolutely fine in PCIE5+, Netscape 4, Netscape 6, Opera and
> Mozilla. It however doesnt work. In Mac IE5. It doesnt give an error
> or anything. It just does nothing.
> 
> Anybody know why? Is there something I'm missing?

Some shots in the dark:

-- "register" and "icon" might be reserved words? try renaming?

-- could those parentheses around (counter+1) somehow be messing
something up?

-- where is the variable "counter" set? if it's a global be sure to put
it before the function somewhere invoked with 
"var counter=..."

Those are my thoughts (though I'm just waking up)...

	- Joe <http://artlung.com/>
-- 
...................  Joe Crawford \\ Web Design & Development
.....  mailto:jcrawford at avencom.com \\ http://www.avencom.com
.... San Diego \\ CA \\ USA \\ AVENCOM: Set Your Sites Higher




More information about the thelist mailing list