avoid npe by setting default <input> type "text" when unspecified