Sharepoint changes my value inside a SPListItem on its own!

Tech-Archive recommends: Fix windows errors by optimizing your registry



Dear sharepoint developers,

I am facing a weird issue when updating an item in a custom list.
One filed I have in a list is of type HTML; I have some CSS classes
associated with java script that read certain HTML tags and produce a
tool tip by a mouse over;
the structure of this HTML script is XML-wise as follows:
<snippet>
<a href="#" class="tt">
keyword<div class="ttcontainer">
<span class="tooltip">
<span class="bottom">
<span class="middle">definition</span>
<span class="top"></span>
</span>
</span>
</div>
</a>
</snippet>
My List Item; let's call it 'item' gets updated in a similar way as
follows:
<snippet>
item["field_name"] = "<a href=\"#\" class=\"tt\">keyword<div class=
\"ttcontainer\"><span class=\"tooltip\"><span class=\"bottom\"><span
class=\"middle\">definition</span><span class=\"top\"></span></span></
span></div></a>";
</snippet>
During debug time and before updating, I trace the value and it's as
expected, I confirm that the saved value inside the item["field_name"]
matches exactly the one above; however, after updating:
<snippet>
item.Update();
</snippet>
The value gets changed automatically from sharepoint; my HTML code
above misses two span closing tags and the surrounding double quotes
of the classes are missing as well as follows:
<snippet>
<a href="#" class=tt>
keyword<div class=ttcontainer>
<span class=tooltip>
<span class=bottom>
<span class=middle>definition</span>
<span class=top></span>
</div>
</a>
</snippet>
Concerning the surrounding double quotes, it's not that bad, I can
live without them! but the missing span closing tags! offfff ..., I
had some rough time figuring out how it happens and I had been
reviewing my code for weeks doubting my logic and finally it seemed
that sharepoint changes it from its own!

Any idea on how to fix this? Is this a bug? do I need to pay extra
attention when dealing with fields of HTML type?
I'm puzzled!

Regards
.



Relevant Pages

  • Re: Sharepoint changes my value inside a SPListItem on its own!
    ... I am facing a weird issue when updating an item in a custom list. ... One filed I have in a list is of type HTML; ... The value gets changed automatically from sharepoint; ... above misses two span closing tags and the surrounding double quotes ...
    (microsoft.public.sharepoint.portalserver.development)
  • Sharepoint changes my value inside a SPListItem on its own!
    ... I am facing a weird issue when updating an item in a custom list. ... One filed I have in a list is of type HTML; ... above misses two span closing tags and the surrounding double quotes ...
    (microsoft.public.sharepoint.portalserver)
  • [Audio] Real Synthetic Audio - New Show Online!
    ... Another week goes by as I struggle to remember how to mess around with HTML and not be lazy by using a fancy editor. ... updating the site is much easier even if I have to think occasionally. ...
    (rec.music.industrial)
  • Push technology in javascript
    ... the tables field are updating from time to ... in HTML + JavaScript (or eventually using CGI?) ...
    (comp.lang.javascript)
  • Re: AJAX, why not Applets
    ... > - snippet of JS ... HTML/CSS/JS several times, but always given up before I've started. ... You can use a signed applet, and extend the usefullness of the ... > well designed HTML and some snippets of JS. ...
    (comp.lang.java.programmer)