I'm trying clear the value of a lookup field via Javascript. I've tried this:
crmForm.all.new_mylookupfield.DataValue = null;
But that isn't working. I inspected the DataValue of the lookup when it was in fact cleared and it returned a null.
alert(document.getElementById("new_mylookupfield").DataValue == null); // true
I'm must be missing something here....
Thanks for the help!
UPDATE: I finally got around to testing some of the suggestions. I'm not sure what I was doing wrong initially, but both of these methods work to clear a lookup via JavaScript:
crmForm.all.new_mylookupfield.DataValue = null;
crmForm.all.new_mylookupfield.DataValue = [];