0

Assuming I have an HTML table with these info (writing as text but it's html behind):

lastname: MyName
firstname: MyFirstName
tel: 04 50 12 34 56
email : bla@mail.com

In html I wrote the tel field like that :

<a href="tel:+33450123456">04 50 12 34 56</a>

When i'm on iOS, if I click on the anchor it asks me if I want to call or create contact. I want then to create a contact with all my informations already filled. Any idea? Only with HTML or JS or JQM please

j08691
  • 204,283
  • 31
  • 260
  • 272
TecHunter
  • 6,091
  • 2
  • 30
  • 47
  • Related: [Address book - how to add a contact to iPhone's address book from a web-page](http://stackoverflow.com/questions/1773876/how-to-add-a-contact-to-the-iphones-address-book-from-a-web-page). – David Thomas Feb 29 '12 at 16:40
  • Related: http://apple.stackexchange.com/questions/22177/importing-vcards-from-a-website-into-ioss-contacts-app – Phill Pafford Feb 29 '12 at 16:41
  • It's not like vCard, i want it to be pure web based. – TecHunter Feb 29 '12 at 23:57

2 Answers2

1

You can use PhoneGap's Contact API. There is a save method method that you can call.

Just bind an click handler to the anchor tag and put the code to invoke the PhoneGap API in the handler.

Matt Accola
  • 4,090
  • 4
  • 28
  • 37
0

I'm pretty sure this isn't possible. iOS has a bunch of url schemes included in Safari that you can take advantage of, but adding a complete new contact isn't one of them.

More information on the available schemes here:

https://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Articles/PhoneLinks.html

will
  • 4,557
  • 6
  • 32
  • 33
  • "bunch" is not enough. I already use tel anchor but the thing I want is to tag elements like for a username/password in a form or an address form in chrome. I want Safari to get the name, lastname and such automatically from my form if you prefer – TecHunter Feb 29 '12 at 23:59
  • 1
    And my answer is that it's not possible, unless - like user1132647 above is assuming - you are using PhoneGap. I was simply linking you to a page that explained about URI schemes and listed the ones that were possible to show you that what you want to do isn't possible. – will Mar 01 '12 at 10:13