richTextItem, safeLink issue

Hi,

I have a text field where user is entering website. I am using below line of code to provide a link to the user to navigate to the website.

Issue is when user to try to enter link "www.google.com" or "google.com" and when they came to the link and hit it is throwing an error.

if(
a!isNotNullOrEmpty(ri!site),
a!richTextItem( text: ri!site, link: a!safeLink(uri: ri!site,openLinkIn: "NEW_TAB")
),
""
)

Any suggestions from anyone.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    they came to the link and hit it is throwing an error.

    I don't have many suggestions without first knowing some detail about the error message the user is getting.  Why not post the error text and/or a screenshot at least?

    The two things I can think of in advance:  1) are you doing any sort of verification that the user is typing a valid URL?  2 ) Are you appending "http://" (etc) to the beginning of the URL being supplied, or are you assuming they'll type it?

Reply
  • 0
    Certified Lead Developer
    they came to the link and hit it is throwing an error.

    I don't have many suggestions without first knowing some detail about the error message the user is getting.  Why not post the error text and/or a screenshot at least?

    The two things I can think of in advance:  1) are you doing any sort of verification that the user is typing a valid URL?  2 ) Are you appending "http://" (etc) to the beginning of the URL being supplied, or are you assuming they'll type it?

Children