I think you'd need to declare 'selvalue' as a string object to use the length property, as in the example I posted for you. I don't think a 'var' has the length property. That's probably why it's telling you that it's expecting an object.

Paul