in reply to CGI delete attributes set in textfield()

Untested, but this might work without having to pull any libraries in:
$string .= $cgi->textfield( -name => 'name', -default => 'def', -override => 0, -size => 20, -maxlength => 120, -onfocus => "if (null == this.changed) this.value = ''", -onblur => "if (null == this.changed) this.value = 'def'", -onchange => "this.changed = true", );