I injected into a sharepoint list some custom html, and one of
the elements in the html is a button. When you click on the button, it is
supposed to toggle one of the elements in that html. Now, the html gets into
the list just fine.
My problem is, that when I click on the button, it makes the entire sharepoint
page reload (I think that is a postback), and thus, I lose the effects of
clicking the button. As you can see, I added a "return false" in the
javascript, but it doesn't make any difference.
What do I do?
My html
var buttonhtml = "<tbody><tr><td colspan='100%'><button
onclick=javascript:ToggleButtonFunction("+ divElementToToggle+"; id='"+
whatbuttonID +"'>Toggle Statistics</button></td></tr></tbody>"
my javascript function:
function ToggleButtonFunction(togglewhat){
$(togglewhat).toggle(
function () { $(togglewhat).show("fast"); },
function () { $(togglewhat).hide("fast"); }
);
return false
}