function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AnshulJainAnshulJain 

create a hyper link if the value entered is a url in <apex:inputTextarea>

Hi can anyone help me with creating a hyper link it the value entered is a url in the textbox.

 

thanks in advance to anyone who helps :)

Best Answer chosen by Admin (Salesforce Developers) 
Edwin VijayEdwin Vijay

You can use javascript to validate if the value is an URL

function checkURL(value) {
  var urlregex = new RegExp(
        "^(http:\/\/www.|https:\/\/www.|ftp:\/\/www.|www.){1}([0-9A-Za-z]+\.)");
  if(urlregex.test(value))
  {
    return(true);
  }
  return(false);
}

 You could then use different div's to display if the value is URL