O'Reilly logo

iPhone JavaScript Cookbook by Arturo Fernandez Montoro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a new contact

The goal for this recipe will be to add a new contact inside the address book of the iPhone. We'll use a simple form with the basic data for a new contact: first name, last name, and phone number. The user can type this data inside the mentioned form. By clicking on a button the contact will be added. A simple alert box will notify this action to the user.

All code required for this recipe can be found at code/ch08/newContact in the code bundle provided on the Packtpub site.

Getting ready

Make sure you've installed PhoneGap and UiUIKit on your Mac computer.

How to do it...

  1. Our first task will be to create a new PhoneGap project using Xcode and the PhoneGap-based template. Edit the index.html file stored in the www folder. Before ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required