Error message: method "removeAttribute" not supported

M

Martin Eckart

Hi NG,

In my form I need to check via Code if there are fields which have the value
"xsi:nil" and if they have then I need to replace that value.

What I did is:

var donation1 = GAYE.selectSingleNode("Registration/donation1").text;
if (donation1.getAttribute("xsi:nil"))
donation1.removeAttribute("xsi:nil");

The Error message I get is at line 2 of the snippet:
"Object doesn't support this property or method"

Searching the web I was not able to find the correct answer. Maybe this is
the right place :).

Thanks,
Martin
 
S

S.Y.M. Wong-A-Ton

If

if (donation1.getAttribute("xsi:nil"))

is line 2, then it means that "donation1" does not have a property called
"getAttribute", which in turn means that you did not retrieve the object
"donation1" correctly. I'm not sure what "GAYE" is in your case, but
remove the ".text" at the end of the first line and see what happens. So try

var donation1 = GAYE.selectSingleNode("Registration/donation1");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top