 
 		if @_regexp
 			@__regexp = new RegExp(@_regexp, @_regexp_flags)
-			@_prevent_invalid_input = false
-			@_checkInput = @__checkInputRegexp
-
-		if @_required and not @_checkInput
-			@_checkInput = (opts) =>
-				opts.value.trim().lengt > 0
+			# @_prevent_invalid_input = false
+			@__checkInput = (value) =>
+				if not @__checkInputRegexp(value)
+					false
+				else if @_checkInput
+					@_checkInput(value)
+				else
+					true
+
+		if @_required
+			@__checkInput = (value) =>
+				if value.trim().length == 0
+					false
+				else if @_checkInput
+					@_checkInput(value)
+				else
+					true
 
 		if @_spellcheck == false
 			@__spellcheck = "false"
 		else
 			@__spellcheck = "default"
+
+		if @_rows
+			assert(@_content_size, "new Input", "opts.rows can only be used with opts.content_size set.", opts: @opts)
 
 		if @_autocomplete == true
 			@__autocomplete = "on"

				check: Boolean

	readOpts: ->
		if not isEmpty(@opts.regexp)
			assert(not (@opts.checkInput), "new Input", "opts.regexp conflicts with opts.checkInput.")
			assert(not @opts.hasOwnProperty("prevent_invalid_input"), "new Input", "opts.prevent_invalid_input conflicts with opts.regexp.")

		if @opts.readonly
			assert(not (@opts.getCursorBlocks or @opts.getInputBlocks or @opts.checkInput), "new Input", "opts.readonly conflicts with opts.getCursorBlocks, opts.getInputBlocks, opts.checkInput.")


		if @_checkInput
			@addClass("cui-input-has-check-input")
			@__checkInput = @_checkInput

		if @_prevent_invalid_input
			@addClass("cui-input-has-prevent-invalid-input")
