forked from saurabh/orbit4-5
allow ip in url for links
This commit is contained in:
parent
1951c581a2
commit
f7c377d092
|
@ -38,6 +38,13 @@ var FormValidator = function(form){
|
|||
}
|
||||
var reg = new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/);
|
||||
return reg.test(value);
|
||||
},
|
||||
urlwithip : function(value){
|
||||
if(value == "#"){
|
||||
return true;
|
||||
}
|
||||
var reg = new RegExp(/^https?\:\/\/[^\/\s]+(\/.*)?$/);
|
||||
return reg.test(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
url = "#"
|
||||
end
|
||||
%>
|
||||
<%= n.text_field locale, class:"input-xlarge change", data: {"fv-validation" => "required;url;", "fv-messages" => "Cannot be empty.;Must be valid url.;"}, :value=>url rescue "#" %>
|
||||
<%= n.text_field locale, class:"input-xlarge change", data: {"fv-validation" => "required;urlwithip;", "fv-messages" => "Cannot be empty.;Must be valid url.;"}, :value=>url rescue "#" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue