Results 1 to 2 of 2

Thread: Replace string with variable

  1. #1
    Join Date
    Jul 2009
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Replace string with variable

    Hi folks,

    This is probably a really simple answer but for the life of me I just can't get it.

    I'm trying to populate a <select> on run time. I've defined a variable and given it a value and I want to replace the new option string with the value in the variable. Here is the code:

    Code:
    test.options[test.options.length]=new Option("a new option")
    I want to remove the "a new option" string and replace it with:

    Code:
    test.options[test.options.length]=new Option(myvariable)
    Any ideas?

    Thanks

  2. #2
    Join Date
    Jul 2009
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Oops, just realised what i've done.

    Cheers for looking anyway.

    Mods, can you close this please.

    Cheers

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •