Saving the data from the form to the on-device database is very simple. Use the same key value pair to look up the correct record, change the values, commit, and close.
| dbMgr = CreateObject("avantgo.db"); 
    dbSet = dbMgr.open("avgoEmpDir", "w"); 
    var search = dbSet.createSearch("id = " + empId); 
        if(!dbSet.find(search)) { 
            alert("Could find record " + empId); 
            window.location = "index.html"; 
            dbSet.close(); 
            return; 
        } 
        dbSet.lastname = document.updateForm.lastName.value; 
        dbSet.firstname = document.updateForm.firstName.value; 
        dbSet.phonenumber = document.updateForm.phoneNumber.value; 
        dbSet.commit();
        dbSet.close(); | 
| Send feedback about this page using email. | Copyright © 2008, iAnywhere Solutions, Inc. |