05-02-2013 08:05 AM
The Web Client needs to open a new explorer tab and do something like this:
<a href="callto://+49 3727 9999/">+49 3727 9999</a>
The phone number should be taken from the MainPhone.
Anyone ever tried this?
Thanks,
Hartog
05-02-2013 08:25 AM
Several ways to do it:
The easiest is probalby to just do it via Javascript. The sample function below would do it, just pass it a valid phone number
function openDialWindow(phone)
{
w=window.open('','wnd');
w.document.body.innerHTML = "<a href='callto://" + phone + "/'>" + phone + "</a>";
}
05-02-2013 08:49 AM
Thanks,
I've tried this before and I knew the best solution was using javascript. The only part I am missing is how to get the MainPhone text into my Javascript. When I use an alert(phone); nothing will be displayed.
Thanks again,
Hartog
05-02-2013 09:08 AM
phone is a variable I have used. You have to populate it.
For instance, if you have the Phone in a Text box with an ID of "txtPhone", you could do something like:
var phone = document.getElementById('txtPhone').value;
alert(phone); //Should be populated
Or, using JQuery:
var phone = $('#txtPhone').text();
alert(phone);
Or, you could do it server side by building Javascript into a String and then registering it:
something like:
PAGE_ONLOAD EVENT (Server side)
.....
IAccount acct = BindingSource.Current as IAccount;
string jstr = "var phone = '" + acct.MainPhone + "';";
RegisterClientScript jstr // This isn't the syntax, just an example of how/what to do server side to set the phone into a variable.
.....
05-02-2013 10:11 AM
Thanks Raul,
I will try this tomorrow. This was exactly the missing part I was looking for
Much appreciated!
Hartog Elands
05-03-2013 03:26 AM
It's not working. No idea why.
I've got a button on the AccountDetails form and the javascript looks like this:
I've tried this:
var phone1 = document.getElementById('MainPhone').value;
alert(phone1);
nothing happens
And this:
var phone1 = $('#MainPhone').text();
alert(phone1);
Result: empty
Where do I go wrong?
Hartog
05-03-2013 01:02 PM