Putting a variable in document.

Discussion in 'JavaScript' started by bwilky, Sep 1, 2008.

  1. #1
    var textbox = 'sku_field';
    var formbox = 'sku';
    var MyElement = document.getElementById(textbox);
    var fieldtext = document.sku.sku_field.value;

    How would I put the variable texbox where sku_field?

    Thanks,
    Bryce
     
    bwilky, Sep 1, 2008 IP
  2. Sleeping Troll

    Sleeping Troll Peon

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You would have to use a serverside script to post the variable there or alternatively you will need to write to the DOM. Sorry, but there are no short cuts.
     
    Sleeping Troll, Sep 2, 2008 IP