SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    masquerading Nick's Avatar
    Join Date
    Jun 2003
    Location
    East Coast
    Posts
    2,215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    inserting value from popup window to parent window select

    Hi, I am trying to insert the value of a variable gathered from a popup window as an option in a <select> menu on the main window. This is the code I have so far:
    Code:
    var newOption = document.createElement("option");
    	newOption.value = '<?=$userfile_name?>';
    	newOption.appendChild(document.createTextNode('<?=$userfile_name?>'));
    	select.insert(newOption);
    How do I do the rest? I just want to add this new value to the end of the list.
    Nick . all that we see or seem, is but a dream within a dream
    Show someone you care, send them a virtual flower.
    Good deals on men's watches

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Possibility - you need to give a more detailed description in cases like this: where the code is running, how the data was 'gathered' and transferred, and so on. We can't see what how you're doing this.

    Never heard of Select.insert() - Select.add(), maybe. Try:
    Code:
    var newOption = document.createElement("option");
    	newOption.value = '<?=$userfile_name?>';
    	newOption.appendChild(document.createTextNode('<?=$userfile_name?>'));
    	select.appendChild(newOption);
    ::: certified wild guess :::


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
  •