Page 1 of 1

Adding a call button with telephone number from textbox.

Posted: Fri Jun 06, 2014 6:32 am
by Barry Ahern

I am making a contact list as a trail app, and have a "Details page" which displays the clicked contacts contact details. I would like to add a call button that selects the phone number out of an input box and sends it to the phone's dialler.

I added window.location.href='tel:999999999' to the click event of a button, and it worked. But when I tried to use window.location.href='tel:'+ document.getElementById("CallBtn").value Nothing fires at all. What am I doing wrong?


Adding a call button with telephone number from textbox.

Posted: Fri Jun 06, 2014 9:50 am
by Kateryna Grynko

Hi Barry,

Let's add the following code to check what this expression returns:prealert(document.getElementById("CallBtn").value);/pre