Skip navigation.

exploreopera

| Help

Sign up | Help

Bookmarklet to view forms properties and elements.

Here is a bookmarklet that lets you debug forms more accurately.

  javascript:
(function ()
{
  var s = "<title>Forms list</title><i>No action attribute usually means its pointing to the page's url and that something else is submitting the form</i>";
  var f = document.forms;
  for (var i = 0;i < f.length, t = f[i];i++)
    {
      var g = "";
      g += "<fieldset><legend>Form: " + i + "</legend>";
      for (var z = 0;z < t.attributes.length, x = t.attributes[z];z++)
        {
          a = x.name.toLowerCase();
          a = a.substr(0, 1).toUpperCase() + a.substr(1);
          if (g.indexOf(a + ": " + x.value) == - 1)
            g += x.value != "" ? a + ": " + x.value + "<br/>" : "";
        }
      for (var ty = 0;ty < t.elements.length, yu = t.elements[ty];ty++)
        {
          fg = yu.tagName.toLowerCase();
          fg = fg.substr(0, 1).toUpperCase() + fg.substr(1);
          g += "<fieldset><legend>" + fg + ": " + ty + "</legend>";
          for (var mx = 0;mx < yu.attributes.length, my = yu.attributes[mx];mx++)
            {
              hg = my.name.toLowerCase();
              hg = hg.substr(0, 1).toUpperCase() + hg.substr(1);
              g += my.value != "" ? hg + ": " + my.value + "<br/>" : "";
            }
          g += "</fieldset>";
        }
      g += "</fieldset>";
      s += g;
    }
  var y = window.open();
  y.document.write(s);
  y.document.close();
}
)();


It shows the all elements inside a form and the attributes attached to those including the attributes of the form itself.
Hope this helps out with form debugging on difficult pages.
UPDATE: Updated layout a little.

More on VBScriptFix yahoo mail compose editor.

Comments

avatar
Thanx for this bookmarklet.

By Darken, # 12. August 2007, 02:28:30

Write a comment

You must be logged in to write a comment. if you're not a registered member, please sign up.