URL field does not accept a web address - New UI

Posted by IramK on 20-Oct-2015 09:18

Hello,

May be the screenshot explains it all. Do we need to specify the protocol every time (http/https etc)? This wasn't an issue earlier in version 3.2.0.0. I think by default it should be http and then the user can change if required. Any suggestions on how I can achieve this?

Cheers.

Iram

Posted by Srinivas Panyala on 21-Oct-2015 02:14

I have removed the URL field type using the below javascript. I am able to create the record with "www.google.com".  I can see "http://" got appended in list view page.

<script>

(function () {

 try {

   //execute only for new ui...

   if (!rbf_isNewUI()) {

     return;

   }

rbf_getFieldContext('Test').getNode().removeAttr('type');  // Test is integration name of URL Field

 }

 catch (err) {

   if (console) {

     console.log(err);

   }

 }

}) ();

</script>

Thanks

Srinivas

All Replies

Posted by Mohammed Siraj on 20-Oct-2015 09:46

In New UI pages, we are leveraging kendo validation framework to enforce html 5 validity constraints like input type 'url'.

The reason kendo is flagging it as invalid URL is because the entered value is missing protocol scheme: i.e. http://www.google.co.in/

Posted by jsniemi79 on 20-Oct-2015 09:50

Mohammed,

I understand that answer, but from the end user perspective, it isn't very helpful.  With the ability for users to simply type www.randomsite.com into any browser on any device and have a connection, there aren't going to be many users that would instinctively type in the http:// or https://.  I would argue this is a defect and should handle Iram's scenario above.

Posted by Mohammed Siraj on 20-Oct-2015 10:41

Yes, agree that we need to have more permissible client-side validation in this case.

For now, to ensure that strict URL constraints are not enforced on URL field, you can replace input control type="url" with type="text".

Eg:

var fieldContext = rbf_getFieldContext('urlA');//'urlA' is integeration name of field

if(fieldContext){

 var node = fieldContext.getNode();

 node.attr('type','text');

}

This way you can circumvent client-side validation. However, any other grave validation errors will still be reported via server-side validations.

In forthcoming releases, will review & update client-side validation to be more permissible in such scenarios.

Posted by Srinivas Panyala on 21-Oct-2015 02:14

I have removed the URL field type using the below javascript. I am able to create the record with "www.google.com".  I can see "http://" got appended in list view page.

<script>

(function () {

 try {

   //execute only for new ui...

   if (!rbf_isNewUI()) {

     return;

   }

rbf_getFieldContext('Test').getNode().removeAttr('type');  // Test is integration name of URL Field

 }

 catch (err) {

   if (console) {

     console.log(err);

   }

 }

}) ();

</script>

Thanks

Srinivas

Posted by IramK on 21-Oct-2015 03:16

Thanks @Srinivas,

The above code works nicely. However could we please have this feature in the next release? Kindly let me know.

Cheers.

Posted by Thierry Ciot on 22-Oct-2015 09:49

We will check with Kendo UI engineering if they have an update on this.
 

Posted by Mohammed Siraj on 23-Oct-2015 07:16

We have addressed this at Rollbase end for 4.0.3. Also, going forward will seek a built -in solution from Kendo library.

Posted by IramK on 23-Oct-2015 08:20

That's great to know. Looking forward to the update.

Cheers.

Iram

Posted by IramK on 12-Nov-2015 08:21

Hello,

Theres a small issue with this: It accepts anything in the field now i.e. www.goog will also be accepted and saved. Can we not make it only check for a proper URL without the protocol?

Posted by Mohammed Siraj on 13-Nov-2015 02:41

Iram, we are just validating the URL syntax (as per URI spec) & do not actually test if the resource does exist.

As per URI spec - scheme:scheme-specific-part?query#fragment &

URL subset syntax <scheme>://<authority><path>?<query>,

http://www.goog is a valid URL.  

Posted by IramK on 13-Nov-2015 03:21

Just a suggestion: We could perform regex field validation for that URL field to test this, correct?

Posted by Mohammed Siraj on 13-Nov-2015 03:52

Iram, there seems to be some confusion here. We are already validating the URL syntax as per URI spec, as stated in my earlier post.

That is, http://www.goog is verified against syntax <scheme>://<authority><path>?<query

http is scheme. (This is mandated)

www.goog is authority.

path & query are optional.

Issue here is www.goog does not translate to a valid host/domain-name. However, as per syntax it is VALID.

To confirm that validation is happening, you can try entering the following invalid examples:

http://123 (verifying ip address in case of numerical input)

http://a$c.com (there are restrictions on character set allowed for domain name)

This thread is closed