Input via textbox

Discussion in 'Code Snippets and Tutorials' started by Fexxel, Oct 7, 2009.

  1. Fexxel

    Fexxel Level IV

    Joined:
    Jan 28, 2009
    Messages:
    959
    Likes Received:
    26
    Problem:
    Alright. I'm trying to make a swagbucks generator to help some people out. I thought it'd be simple (it'd be incredably easy in VB.net) but it sure as hell isn't in GM (well, for me. XD).
    I'm trying to do something like this:
    Code (Text):
    1.  
    2. var swaginput = (how do I make a textbox?)
    3. var swaginput2 = (how do I make a textbox?)
    4. document.body.AppendChild(swaginput)
    5. document.body.AppendChild(swaginput2)
    6. var cmdgo = var add = document.createElement("button");
    7. add.innerHTML = "Go!";
    8. document.body.AppendChild(cmdgo)
    9. add.addEventListener("click", function() {document.location.href('http://swagbucks.com/?sourceid=Mozilla-search&q=' + swaginput.text);
    10. set.windowTimeout((document.location.href('http://swagbucks.com/?sourceid=Mozilla-search&q=' + swaginput2.text'), randomref);
    11. }
    12.  

    + // How do I 'appendchild' to a seperate part of the document? {ex: document.TheXpathOfAPlaceOnThePage.AppendChild?}

    I know I probably have countless (not just probably, but 99.99999% says I do) errors in syntax and code. All suggestions are VERY very welcome.
    <3
    Fex