You are viewing limited content. For full access, please sign in.

Question

Question

Feature Request: URL Field Type

asked on July 27, 2015

It would be very useful if there was a field type of URL.

0 0

Replies

replied on July 27, 2015

You can convert any regular single line field to a URL field by adding your own pattern as an attribute:

$(document).ready(function() {
  
  var urlPattern = "(http|ftp|https):\\/\\/[\\w-]+(\\.[\\w-]+)+([\\w.,@?^=%&:\\/~+#-]*[\\w@?^=%&\\/~+#-])?";
  $('#q17 input').attr('title', "URL Field");
  $('#q17 input').attr('pattern', urlPattern);

});

#q17 will be the id of your field.

 

0 0
replied on July 27, 2015

Ege, thank you. We have been using the regular expressions to do what we need to, but it would be nice if there was a field already created like, numbers, email address, etc.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.