Hi,
I've noticed that Extension:InputBox generates HTML with only the
"name" attribute, but no id. Is this a feature or a bug?

I'm asking because I'm trying to get a "onsubmit" hook for a form
generated by this extension. I tried doing something like:

if (document.getElementsByName('createbox').length)
  {
    var i=0;
    for(i=0; i < document.getElementsByName('createbox').length; i++){
      document.getElementsByName('createbox')[i].onsubmit=function() {
        var 
ta=document.getElementsByName('createbox')[i].getElementsByName('name')[0];
        if(!ta){
          return true;
        }
        //do stuff
      }
    }
  }

(actually the code is a little cleaner, but this is a more concise form)

I'm getting a "document.getElementsByName('createbox')[i] is undefined
error", even if firebug reports the getElementsByName function returns
an array with 1 element. Could some JS-wizard help me out on that?

Thanks,
  Strainu

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to