I am creating an app that contains a subfile that has a phone number as one of the elements. I want to use the 'onclick' function to initiate a call when a number is selected. I'm pretty new to this and could use some insight. this is what I tried:
window.location("tel:" + DPPHONE.row);
where DPPHONE is the element ID of the number to be called. iPhone errors with "Onclick Error: Can't find variable: DPPHONE"
auto dialing
-
- New User
- Posts: 4
- Joined: Mon Mar 02, 2015 11:30 am
- First Name: Dean
- Last Name: Bowman
- Company Name: PGT Trucking
- Contact:
- Glenn
- Profound Logic Staff Member
- Posts: 124
- Joined: Mon Apr 14, 2014 4:08 pm
- First Name: Glenn
- Last Name: Hopwood
- Company Name: Profound Logic Software
- State / Province: Ohio
- Country: United States
- Contact:
Re: auto dialing
Dean,
I believe an easier way to do what you want is to make the phone number field a hyperlink widget and bind the 'value' and 'hyperlink reference' to DPPHONE. The iPhone should automatically recognize that the link is referencing a phone number and open the dialer. Let me know if that works for you.
Glenn
I believe an easier way to do what you want is to make the phone number field a hyperlink widget and bind the 'value' and 'hyperlink reference' to DPPHONE. The iPhone should automatically recognize that the link is referencing a phone number and open the dialer. Let me know if that works for you.
Glenn
- Glenn
- Profound Logic Staff Member
- Posts: 124
- Joined: Mon Apr 14, 2014 4:08 pm
- First Name: Glenn
- Last Name: Hopwood
- Company Name: Profound Logic Software
- State / Province: Ohio
- Country: United States
- Contact:
Re: auto dialing
Dean,
Sorry, I misspoke. What I suggested will probably only work in a mobile app (that's what I get for posting before testing...). If you are doing this in a mobile web page then your code is almost correct.
The code you have in the 'onclick' event should look like this:
Keep in mind that we want the value contained in DPPHONE not the object named DPPHONE. The get() API that we provide will return the value. It's a shortcut for the JavaScript notation of getElementById().value.
Sorry for the confusion.
Glenn
Sorry, I misspoke. What I suggested will probably only work in a mobile app (that's what I get for posting before testing...). If you are doing this in a mobile web page then your code is almost correct.
The code you have in the 'onclick' event should look like this:
Code: Select all
window.open("tel:" + get("DPPHONE." + row));
Sorry for the confusion.
Glenn
-
- New User
- Posts: 4
- Joined: Mon Mar 02, 2015 11:30 am
- First Name: Dean
- Last Name: Bowman
- Company Name: PGT Trucking
- Contact:
Re: auto dialing
Thanks Glen; I figured out the hyperlink last night; will keep both solutions for future development.
Who is online
Users browsing this forum: No registered users and 15 guests