This works not by disabling the key, but removing what it produces: spaces smile
It's simply replacing the edit's text [ did -ar ] with a "space-free" version of the text [ $remove(former_text,$chr(32)) ].
Type /nospaces to test...
Code:
alias nospaces { dialog $iif((!$dialog(nospaces)),-m,-x) nospaces nospaces }

dialog -l nospaces {
  title "no spaces in the edit"
  size -1 -1 200 30
  option dbu
  edit "", 1, 10 10 180 10
}

on *:DIALOG:nospaces:EDIT:1: { did -ar $dname $did $remove($did($did),$chr(32)) }