Tuesday, August 16, 2011

jquery treeview toggle button submitting form

Came across this issue after copying some code from a jquery treeview demo. Once I put the code into a form, it would keep submitting the form before it could drop down the tree.

Found that the sample code had: <button id="add"> This makes the aspx page assume it is of type "submit". I needed to add <button id="add" type="button"> to make it stop submitting on click.