Be careful with the following in your solution:
var l = listName !== undefined ? listName : $().SPServices.SPListNameFromUrl();I think some browser (IE v???) will throw an error if listName is undefined (because your trying to use it)... It may be safer to:
var l = (typeof listName !== "undefined") ? listName : $().SPServices.SPListNameFromUrl();
As Eric mentioned, this may fix some of the issues that (lately) keep popping up here about the field name being _undefined and values not being saved. :)
_________
Paul T
Paul T