cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alf Stockton <...@stockton.co.za>
Subject Retrieve cell phone number
Date Tue, 21 May 2013 13:52:41 GMT
Based on the API at phonegap I have put together the following HTML in a 
test to see if I can retrieve the cellphone number when I browse to this 
html from my cell phone. I have obviously misunderstood something for I 
would expect to see the cellnumber in the cellnumber field on the form 
but no such luck.
I would be grateful for any helpful suggestions.

<!DOCTYPE html>
<html>
   <head>
     <title>Contact Example</title>

     <script type="text/javascript" charset="utf-8" 
src="cordova-2.7.0.js"></script>
     <script type="text/javascript" charset="utf-8">

     // Wait for Cordova to load
     //
         function onDeviceReady() {
         var myContact = navigator.contacts.create({"displayName": "Test 
User"});
         document.cellnumber = new ContactField('mobile', 
myContact.cellPhone, true);
     }


     </script>
   </head>
   <body>
     <h1>Example</h1>
     <p>Create Contact</p>
<input id="cellnumber" name="cellnumber" >
   </body>
</html>

-- 
Regards,
Alf Stockton                 www.stockton.co.za
Everything will be all right in the end... if it's not all right then it's not yet the end.


Mime
View raw message