Monday 25 January 2010

Sortable.create - Sortable is Not Defined

The DragDrop capability offered by Scriptaculous is tremendous, but is not good on error messages. What does one do with the error "Sortable is Not Defined" on a "Sortable.create" statement?

The answer, from my experience, is to look hard at the coding of the page. When I have hit this problem it has normally (perhaps always) been because "echo" statements for debugging had resulted in a page source which showed the "body" tag appearing far sooner than I had intended, and that seemed to be what was spooking the Sortable.

Thursday 21 January 2010

vertical-align - ok on td but not table (or tr or tbody)

The vertical-align css property appears to be valid only at a td level. There is a hint of this (but not explicit statment) in the w3.org documentation

Friday 15 January 2010

Styling select options using span or strong?

Searching around, it looks as if this cannot be done in HTML with or without CSS.

To quote :
option tags do not allow other tags within them (it's not valid html).
firefox, for example, simply removes them from the DOM when it renders it. 


It's easy to style the whole option tag. What you don't seem to be able to do is to style just part of an option.


The application was a list of users within our village. Name formats will vary, and it won't always be obvious which is the right one to sort on. Eg "Newtown Tennis Club" might be known just as the "Tennis Club". The solution was to specify a separate sort name for each user, and to sort the options in that order. I wanted to highlight the sorted term in bold: cannot do. Capitalising is the best I have been able to do.


Isn't HTML a pain?