i have a control on the page that is an image:
<IMG style="BORDER-RIGHT-WIDTH: 0px; WIDTH: 100%; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; HEIGHT: 100%; BORDER-LEFT-WIDTH: 0px" id=ctl00_ctl38_g_e05451aa_ea4f_4e2f_adf1_50fc0a6edb84_ctl00_ListForm2_formFiller_FormView_ctl30_ctl12_595dbbb6_2a8c_46ea_b0ec_06a88ebef06c_ctl01_ctl11_f067f2dd_39e0_4ca5_825c_c2495c422fb2 class="serviceSearch1 nf-image" alt="Find a service" src="/Style%20Library/workflow/lbg%20ccr/Images/findLogo24.png" jQuery110209154273117302492="20">
that is fine an i can get the correct ID.
when another image is added dynamically using JS it looks like this:
<IMG style="BORDER-RIGHT-WIDTH: 0px; WIDTH: 100%; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; HEIGHT: 100%; BORDER-LEFT-WIDTH: 0px" id=2_ctl00_ctl38_g_e05451aa_ea4f_4e2f_adf1_50fc0a6edb84_ctl00_ListForm2_formFiller_FormView_ctl30_ctl12_595dbbb6_2a8c_46ea_b0ec_06a88ebef06c_ctl00_ctl11_ad824e8a_1581_470c_a6c9_223e6d8c2370 class="serviceSearch1 nf-image" name=2_ alt="Find a service" src="/Style%20Library/workflow/lbg%20ccr/Images/findLogo24.png" jQuery110209154273117302492="18">
when i get this ID it returns the first image ID and not with the value of "2_" or the new name attribute added into the dynamic object, code just returns blank.
code is based on the click event of the clicked image class:
$('.serviceSearch1 .nf-image').click(function () {
alert(this.name);
alert(this.id);
});
on the browser source i can see the correct values though. Im confused as to what is going on and any help would be greatly appropriated!
I have no control over the html and javascript automation. That is due to a third party!
it looks like the browser as shown above is uptodate but in code its not updating (has old values).
marked in blue is the new repeating section that is auto generated (not by me by third party):
in each repeating section contains an image that i have shown above.
as noted when the image is clicked it calls the click event but the attribute values are all old. The first image contains no name attribute but any new repeating control does noting its current index. so first has none, second has "2_", third has "3_" and so on.. i need those name values but when i access them on the click event its blank and the ID's are the same as the first image. The controls are added dynamically by third party which i assume is using JS. hope that helps.