1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Output all Form elements with firebug in firefox

Discussion in 'General Programming Chat' started by dacash, Sep 2, 2008.

  1. dacash

    dacash Registered Member

    Joined:
    Jan 28, 2008
    Messages:
    52
    Likes Received:
    16
    Location:
    on the dark side.
    This will print out all the form elments name and value. Nice do have when coding a script that post or get to a page.


    var x = document.getElementById(?FORMID?);
    var bod;
    for (var i=0;i<x.length;i++)
    {
    bod = bod + x.elements.name + ? : ? + x.elements.value + ?<br>?;
    }
    document.body.innerHTML = bod;
    }