Improved error messages for type attributes.
This commit is contained in:
parent
91bdf9f814
commit
cabb1c89d1
1 changed files with 2 additions and 2 deletions
|
@ -769,8 +769,8 @@ to send no browser reload event, pass false
|
||||||
|
|
||||||
# validate data_option
|
# validate data_option
|
||||||
if data_type == 'input'
|
if data_type == 'input'
|
||||||
raise 'Need data_option[:type] param' if !data_option[:type]
|
raise 'Need data_option[:type] param e. g. (text|password|tel|fax|email|url)' if !data_option[:type]
|
||||||
raise "Invalid data_option[:type] param '#{data_option[:type]}'" if data_option[:type] !~ /^(text|password|tel|fax|email|url)$/
|
raise "Invalid data_option[:type] param '#{data_option[:type]}' (text|password|tel|fax|email|url)" if data_option[:type] !~ /^(text|password|tel|fax|email|url)$/
|
||||||
raise 'Need data_option[:maxlength] param' if !data_option[:maxlength]
|
raise 'Need data_option[:maxlength] param' if !data_option[:maxlength]
|
||||||
raise "Invalid data_option[:maxlength] param #{data_option[:maxlength]}" if data_option[:maxlength].to_s !~ /^\d+?$/
|
raise "Invalid data_option[:maxlength] param #{data_option[:maxlength]}" if data_option[:maxlength].to_s !~ /^\d+?$/
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue