Barry Ahern
Posts: 0
Joined: Thu Jun 05, 2014 1:39 pm

Adding a call button with telephone number from textbox.

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?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Adding a call button with telephone number from textbox.

Hi Barry,

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

Return to “Issues”