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
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/
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.
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.
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
Thanks @Srinivas,
The above code works nicely. However could we please have this feature in the next release? Kindly let me know.
Cheers.
We have addressed this at Rollbase end for 4.0.3. Also, going forward will seek a built -in solution from Kendo library.
That's great to know. Looking forward to the update.
Cheers.
Iram
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?
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.
Just a suggestion: We could perform regex field validation for that URL field to test this, correct?
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)