Javascript question

Ian Stephen ianstepn
Mon May 17 11:55:29 PDT 2004


On Sun, 2003-11-09 at 18:36, joel wrote:
> I am going over some of my html/javascript beasties that I wrote for 
> work. I am still confounded why these don't work properly in netscape or 
> mozilla but do in opera6 and IE 5.5.
> 
> For example, these buttons don't display properly in mozilla:
> 
> <input type="button" value="Reset this form" onClick="ClearForm(form1)">
> 
I copied and pasted that line into a bare html page and it displayed
fine in my Mozilla 1.3.1

> Then, mozilla doesn't handle arrays, for example, this function doesn't 
> work:
> function ClearForm(form){
> for (i=0; i < form.length ; i++) {
>  form[i].checked = false
>  if (form[i].value.search(/^MARGINS *\$1U? *$/) > -1){form[i].checked=true}
>  par[i] = "" }
>  form[1].checked = true
> }

Haven't tried this function in a form (yet), but a line from a function
of mine that does work may give a lead...

for (var Index = 0; Index < recipientArray.length; Index ++)

maybe the "var" is needed?

IanS



More information about the Linux-users mailing list