The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Adding Javascript to Items in Repeater

I'm repeating a collection of controls that allows the user to edit a note inside of a textarea (TextBox). There are basically 2 panels, one which contains controls to view a note (if it exists) and another panel which contains controls to edit the note. Finally there is a Hyperlink to click to create the note.

Although there are many controls, the only 2 that require server actions are the 'save' and 'delete' action. So, I'd like to use javascript to control all other aspects, for instance:

1. If the user clicks the 'create' hyperlink, show the edit panel.
2. If the user clicks the 'edit' hyperlink, put the note in the textarea and show the edit panal.
3. If the user clicks the 'cancel' hyperlink, disregard the changes, hide the edit panel and show the note panel.
etc...

Currently I'm working on displaying the edit panel 'panNoteEdit' when the user clicks the edit hyperlink 'hlCreateNote'. This works somewhat, but not exactly how I need it to. If I set a panel's visibility to 'hidden' in javascript, the problem is the control still takes up space, but I want it to 'collapse'. The problem I'm having is when I try to set , but when I try to apply 'collapse' to the visibility property of the panel, I get an error:

Exactly. Make them visible in the code behind, but give them a class that sets their display to none. In your javascript add another class that overrides that, or use a library (like jQuery) to do a fancy slide out animation.

This is a bit of an old thread but I've noticed a problem in IE6. If I try to re-order my players the elements in the 'notes' area all get rendered, which breaks the layout. If you go to this page and use the drag handle to re-order players in IE6, you'll see my problem. Is there any way to hide these items even when reordering so that the layout doesn't get broken in IE6?

Here is an explanation of my conundrum:

1. If I don't set my element's visible to true', but hide it with css {display:none;} it will still show up when I reorder by list, thereby breaking my layout
2. However, if I set the visible to 'false', it won't break my layout when I drag, but I also won't have access to the element in javascript to because it isn't even listed in html.

The whole reason I'm using javascript in the first place is because there are too many elements to fix into a small area, so I hide/show elements based on certain criteria, but it appears that when I reorder my list all elements are shown regardless of their stylings.