<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: firebug code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Tue, 19 Aug 2008 21:50:52 GMT</pubDate>
    <description>DZone Snippets: firebug code</description>
    <item>
      <title>Extracting the values of all forms on the page</title>
      <link>http://snippets.dzone.com/posts/show/3569</link>
      <description>This is a simple piece of javascript intended to be run from Firebug or as a bookmarklet which extracts all the name : value pairs from forms on the page and pops up a new window listing them.&lt;br /&gt;&lt;br /&gt;It's not very well written, and doesn't yet handle any non input form elements, but it will do for now. :-)&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;var displayWindow = window.open();&lt;br /&gt;&lt;br /&gt;function showFormValues(form ) { &lt;br /&gt;    displayWindow.document.write('Form:');&lt;br /&gt;    displayWindow.document.write(form.name);&lt;br /&gt;    displayWindow.document.write('&lt;br&gt;');&lt;br /&gt;&lt;br /&gt;    var formElements = form.getElementsByTagName('input');&lt;br /&gt;&lt;br /&gt;    for (var i = 0; i &lt; formElements.length; i++){&lt;br /&gt;        var element = formElements[i];&lt;br /&gt;        &lt;br /&gt;        displayWindow.document.write(element.name + ' :  ' + element.value + ' &lt;br&gt;');}} &lt;br /&gt;&lt;br /&gt;Array.forEach(document.forms, showFormValues);&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;</description>
      <pubDate>Fri, 23 Feb 2007 08:44:01 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3569</guid>
      <author>DRMacIver (David R. MacIver)</author>
    </item>
  </channel>
</rss>
