Quantcast
Channel: Adobe Community : Popular Discussions - CQ5 (read only)
Viewing all articles
Browse latest Browse all 12476

How to get href="tel:phonnumber" working? (click on a link and call on mobile)

$
0
0

Hi,

 

I am trying to develop a component for a mobile website which allows users to click on a link and make a phone call on the mobile device.

 

I have tried to use the following code :

 

<a  href="tel:<%=xssAPI.encodeForHTML(tel)%>" >Click and Call!</a>    // where tel is for instance: 12345678

 

But CQ keeps displaying:

 

localhost:4502/content/mysite/_tel_12345678

 

I need the link to display as tel:123456789

 

I've also tried using href="http://tel:<%=xssAPI.encodeForHTML(tel)%>" which displays 'tel:12345678' when mouse hovering over on a computer. However, as soon as I deploy the code on a mobile device and press on the link, it redirects to 'http://tel.12345678' which results in an error page.

 

Has anyone had any experience in bypassing CQ's URL prefixing and force the href to be what the user input is?

 

Many thanks.


Viewing all articles
Browse latest Browse all 12476

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>