html unique id attribute

Hi,

In order to create 2 different connections through 2 different links,
I have to add the following code in 2 parts of the html code:

<a id="enabled_element" href="#">

As the id attribute should be unique, only the first link is active.

How can I do to activated also the second link?

Thanks for pointing me in the right direction.
lupireAsked:
Who is Participating?
 
Julian HansenCommented:
bottom line - you cannot have duplicate ID's only the last one will count.
0
 
Tom BeckCommented:
Can you use class="enabled_element" instead?

EDIT:  I just realized you are probably referring to Outlook Groupware connections of which I am not familiar.
0
 
Julian HansenCommented:
Why does the element have to have the same id - which is obviously not allowed - what is the importance of the enabled_element id - with respect to your code?

Please post more information about your problem - the information you have given is not sufficient for us to be able to assist you.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
leakim971PluritechnicianCommented:
I think it appear disabled/enabled with CSS so, locate the CSS file, look for :

#enabled_element

and replace: #enabled_element
by : #enabled_element, #enabled_element_second

<a id="enabled_element" href="#">
<a id="enabled_element_second" href="#">

Open in new window


or just use a class as suggested by tommyBoy, so replace : #enabled_element
by : .enabled_element

<a class="enabled_element" href="#">
<a class="enabled_element" href="#">

Open in new window

0
 
lupireAuthor Commented:
I have to use the id attribute.
When the application stars, it checks the site content for the specific ID (enabled_element). If these IDs are used on a element, then clicking this element will start an action.
It is because the enabled_element is unique.

But I would like to acivate the action on two different elements of the page.

I cannot use class.

Many thanks
0
 
leakim971PluritechnicianCommented:
>When the application stars, it checks the site content for the specific ID

Could you post(show us) this part?
Could you edit it?
0
 
lupireAuthor Commented:
>>When the application starts, it checks the site content for the specific ID

>Could you post(show us) this part?
>Could you edit it?

Unfortunately I can not edit the code application, I have only to configured the web site.
0
 
leakim971PluritechnicianCommented:
try this :
<a id="enabled_element1" href="#" onclick="this.id='enabled_element';">
<a id="enabled_element2" href="#" onclick="this.id='enabled_element';">

Open in new window


good luck...
0
 
lupireAuthor Commented:
<a id="enabled_element1" href="#" onclick="this.id='enabled_element';">
<a id="enabled_element2" href="#" onclick="this.id='enabled_element';">
                                           

I have to click twice on an element to start the action. But after I can not start the action on the other element.

I seems after having clicked on an element, the id remains setted on the clicked ID.

The only way to start the action on the other element is to reload the page.

Thanks for your help
0
 
leakim971PluritechnicianCommented:
ok, could you post the code setting the "action"?
0
 
lupireAuthor Commented:
I am not allowed to modify this code.
0
 
leakim971PluritechnicianCommented:
>I am not allowed to modify this code.

I don't want to see it to ask you to modify it...
0
 
lupireAuthor Commented:
here is the code:

function() {
      ka.c = [];
      ka.registerApiConsumer = function(callback, apiNames) {
            ka.c.push({a: apiNames, c: callback});
      }      
      ka.setLocale = function(locale) {
            ka.l = locale;
      }
      function h(a, b, c) {
            if (a.addEventListener) a.addEventListener(b, c, false);
            else if (a.attachEvent) a.attachEvent("on" + b, c, true);
      }
      h(window, "DOMContentLoaded", function() {window["x-ka-tmp-dom-ready"] = true;}, false);
      h(window, "load", function() {window["x-ka-tmp-window-alive"] = true;});
      if (!window["x-ka-tmp-window-name"]) window["x-ka-tmp-window-name"]=window.name;
      var q = document.getElementsByTagName("script")[0];
      if (q) {
            var g = document.createElement("script");
            g.setAttribute("src", "https://start.ka.biz/starter.js");
            g.setAttribute("type", "text/javascript");
            g.setAttribute("defer","defer");
            q.parentNode.appendChild(g);
            h(g, "load", function() {});
            h(g, "error", function() {});
      }
})();

many thanks
0
 
leakim971PluritechnicianCommented:
looking for : start.ka.biz/starter.js
0
 
leakim971PluritechnicianCommented:
could you post the code of : start.ka.biz/starter.js ?
0
 
lupireAuthor Commented:
I am not allowed to post it.
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.