| View previous topic :: View next topic |
| Author |
Message |
Koplaf Enthusiastic Coder
Joined: 28 May 2006 Posts: 130
|
CurrentElement.nextSibling.nextSibling.focus() function is working fine in IE but not in firefox
CurrentElement.focus() is also not workin properly in firefox
Any help please
Reply with quote
|
| |
|
|
Peter Pitt Enthusiastic Coder
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
Function nextElement($start){ var $el=$start.nextSibling; while($el && $el.nodeType!=1){ $el=$el.nextSibling; } return $el==$start?null:$el; }
What kind of element is currentElement?
Reply with quote
|
| |
|
|
Koplaf Enthusiastic Coder
Joined: 28 May 2006 Posts: 130
|
I tried getting the id of the element and focussing
Its a textbox
Its like using this.focus()
Reply with quote
|
| |
|
|
Peter Pitt Enthusiastic Coder
Joined: 20 May 2006 Posts: 114 Location: Egypt
| |
Koplaf Enthusiastic Coder
Joined: 28 May 2006 Posts: 130
| |
Peter Pitt Enthusiastic Coder
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
Alert that el's id, value attributes to make sure you have the right one. It doesn't sound like it is.
Reply with quote
|
| |
|
|
Koplaf Enthusiastic Coder
Joined: 28 May 2006 Posts: 130
|
I am passing onchange="validate(this)"
And there i am using this.focus()
Reply with quote
|
| |
|
|
Peter Pitt Enthusiastic Coder
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
Um, you can't name a variable 'this', that's a special identifier and reserved word.
Function($foo){ ... $foo.focus(); ... }
Reply with quote
|
| |
|
|
Koplaf Enthusiastic Coder
Joined: 28 May 2006 Posts: 130
|
i have the function defined as function validate(currentElement)
Reply with quote
|
| |
|
|
Peter Pitt Enthusiastic Coder
Joined: 20 May 2006 Posts: 114 Location: Egypt
| |
| Page 1 of 2 |
Goto page 1, 2 Next |
|