Make website field clickable

Wednesday, December 10th, 2008

On the standard contact form the field website is not clickable. You have to copy the url to a browser address bar. This is probably because of the synchronization with outlook.
To make the field clickable on the form you can add the following code to the OnLoad of the Contact form.

/*** make website field clickable***/
//change color and make underlined
crmForm.all.websiteurl.style.color = "#0000ff";
crmForm.all.websiteurl.style.textDecoration = "underline";
/* Double Click website to Open*/
function CreateURL(WebSite) {
    return function() {
        if (WebSite != null && WebSite.value.length > 0) {
            var prefix = WebSite.value.substring(5, 0);
            if (prefix == "http:") {
                window.open(WebSite.value);
            }
            else {
                window.open("http://" + WebSite.value);
            }
        }
    }
}
crmForm.all.websiteurl.attachEvent('ondblclick', CreateURL(crmForm.all.websiteurl));