473,406 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Updating HTML

I want to try to update a pre-existing html page by adding a certain tag <option> within a <select> tag. The code used below:

Expand|Select|Wrap|Line Numbers
  1. function showDuplicate() {
  2.  
  3. if (!newWin || newWin.closed){
  4.  
  5. newWin = window.open("https://ipp-uiuc.otm.uiuc.edu/greaser/keywords/duplicate.html","duplicateWindow","width=800,height=600,menubar=0,toolbar=0,location=0,directories=0 ,scrollbars=1");
  6.  
  7. storeValue(this.name);
  8. newWin.focus();
  9.  
  10. currentSelection = this.name + "\n";
  11. currentNumSelected++;
  12.  
  13. var ni = newWin.document.getElementById('DuplicateTest1');
  14. var newOption = newWin.document.createElement('option');
  15. newOption.innerHTML = this.name;
  16. ni.appendChild(newOption);
  17. }
  18.  
  19. else{
  20.  
  21. newWin.focus();
  22.  
  23.  
  24. currentSelection = this.name + "\n";
  25. currentNumSelected++;
  26.  
  27. var ni = newWin.document.getElementById('DuplicateTest');
  28. var newOption = newWin.document.createElement('option');
  29. newOption.innerHTML = this.name;
  30. ni.appendChild(newOption);
  31.  
  32. }
  33. }
  34.  
  35. var aAnchors = document.getElementsByTagName('a');
  36. for(var i = 0; i < aAnchors.length; i++)
  37. {
  38. if(/^dup/.test(aAnchors[i].id)){
  39. string = aAnchors[i].name;
  40. if(i == 0 && i == 1)
  41. alert(aAnchors[i].name);
  42. aAnchors[i].addEventListener("click", showDuplicate, false);
  43. }
  44. }

The respective html code segment is:

[HTML]<select id="DuplicateTest1" name="Enabled" size="5" multiple style="width: 100px;"></select>

<select name="Disabled" id="DuplicateTest" size="5" multiple style="width: 100px;">
</select>[/HTML]

This is a greasemonkey script that I'm working on and its just not updating the html file. All I want is for it to display the ids of the links that users have clicked on and I want it to display on an external pre-existing html file called duplicate.html...

What am I doing wrong? Any help would be greatly appreciated.

Thanks
Apr 12 '07 #1
1 1204
acoder
16,027 Expert Mod 8TB
To add options, see link.
Apr 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? ...
0
by: Bob Kaku | last post by:
I'm trying to create a text editing and updating capability to help someone who wants to maintain content on a web page without having to know any HTML or use a web authoring tool and FTP'ng the...
45
by: It's me | last post by:
I am new to the Python language. How do I do something like this: I know that a = 3 y = "a" print eval(y)
3
by: Jim Cobban | last post by:
I have a set of web pages that are organized in pairs. One of each pair contains a graphic and the other is an extended description of the graphic. I am trying to set it up that selecting a single...
10
by: sqlboy2000 | last post by:
Hello all, I have something very simple going on here and I'm scratching my head as to what the problem is. There are 4 items in my project, 2 webforms, a user control, and a module: ...
1
by: cover | last post by:
I'm trying to put together a system that upgrades records in a database and apparently have run into a bit of a glitch. I think the problem is with the $HTTP_POST_VARS portion of the code. Is...
5
by: rosaryshop | last post by:
I'm working a jewelry/rosary design web site at http://www.rosaryshop.com/rosariesAndKits2.php. As the user makes selections, it updates images of various parts, giving them a preview of the...
16
by: Stevo | last post by:
I'm guessing this is a laughably obvious answer to many here, but it's not to me (and I don't have a server or any knowledge of PHP to be able to try it). It's not strictly a PHP question, but...
0
by: BizWeb | last post by:
Hi, i am new to ASP.NET. I have write a very simple code to try the updating of the GridView but it is not updating the data. Below is the simple code that i have use. <%@ Page Language="vb"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.