I'm trying to call javascript native method getElementsByName
to retrieve the list of all elements with the same name (name="").
Here is the code I'm using with Internet Explorer:
std::vector<FB::JSObjectPtr> nameList = DOMdoc->callMethod<std::vector<FB::JSObjectPtr> >("getElementsByName", FB::variant_list_of("name1");
No result is returned. By executing directly the method in javascript, I have the right number of items:
document.getElementsByName("name1")
I also tried to use directly the getElementById which works but returns only one element:
DOMdoc->getElementById("name1")->getJSObject();
Unfortunately I need to retrieve the list of elements for a radiobutton for exemple:
<input type="radio" name="name1" value="value1">Radio 1<br/>
<input type="radio" name="name1" value="value2">Radio 2<br/>
<input type="radio" name="name1" value="value3">Radio 3<br/>
Any help would be greatly appreciated,
Thanks.
UPDATE
Just tried with getElementsByTagName without more success:
nameList = DOMdoc->callMethod<std::vector<FB::JSObjectPtr> >("getElementsByTagName", FB::variant_list_of("name1"));
with name="name"
– Pinal