MDL-38356 JavaScript: Correct check for currentform