Re: Javascript question

2003-11-10 Thread Alan Jackson
On Sun, 09 Nov 2003 21:36:57 -0500
joel [EMAIL PROTECTED] 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.
 

Have you run it in Mozilla with the Javascript debugger open?

I had one last week that worked in Netscape, Konqueror, and Mozilla, but
failed in IE. Turned out that IE has a limit of 1012 characters in a function
call.

-- 
---
| Alan K. Jackson| To see a World in a Grain of Sand  |
| [EMAIL PROTECTED]  | And a Heaven in a Wild Flower, |
| www.ajackson.org   | Hold Infinity in the palm of your hand |
| Houston, Texas | And Eternity in an hour. - Blake   |
---
___
Linux-users mailing list
[EMAIL PROTECTED]
Unsubscribe/Suspend/Etc - http://smtp.linux-sxs.org/mailman/listinfo/linux-users


Javascript question

2003-11-09 Thread joel
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)

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
}

Any insight appreciated,

Joel

___
Linux-users mailing list
[EMAIL PROTECTED]
Unsubscribe/Suspend/Etc - http://smtp.linux-sxs.org/mailman/listinfo/linux-users


Re: Javascript question

2003-11-09 Thread Ian Stephen
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

___
Linux-users mailing list
[EMAIL PROTECTED]
Unsubscribe/Suspend/Etc - http://smtp.linux-sxs.org/mailman/listinfo/linux-users


Re: Javascript question

2003-11-09 Thread Ian Stephen
On Sun, 2003-11-09 at 18:36, joel wrote:

 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
 }

To get the function to do anything I had to change
onClick=ClearForm(form1) to onClick=ClearForm(this.form)

Inserting alert()s into your function to follow its operation it seemed
to work up to and including an 'else {alert(else)}' below your 'if'
line.  After that the alert()s don't run.

Also an alert() inserted to run if the 'if' is true didn't go, but I'm
sorry to admit that I don't know diddly about regular expressions so
don't know if my form entries met the criteria to make the 'if' true. 
Used reg. exp. for the first time a couple of days ago to edit a huge
file in emacs.  Definitely gotta learn more of that!

an alert() outside your for loop never goes, so it seems the for loop
doesn't exit?  Google couldn't find me anything about that 'par[i] = '
line.  What's a par

Oh, and disregard previous post about var.  Makes no difference it
seems.

IanS

___
Linux-users mailing list
[EMAIL PROTECTED]
Unsubscribe/Suspend/Etc - http://smtp.linux-sxs.org/mailman/listinfo/linux-users