Canvas signature touch creates issue in phonegap

后端 未结 2 1436
栀梦
栀梦 2021-01-07 16:34

I found a few posts related to \"phonegap canvas signature\" but they did not help. I have some drop down boxes, text boxes, and one signature field. I want to insert these

2条回答
  •  遥遥无期
    2021-01-07 17:38

    You really should be passing error callbacks to transaction() and executeSql() methods - it'll help debugging your database operations in development. You'll want to use something other than alert() for error handling in production.

    db.transaction(function(tx) {
        // for parts table
        tx.executeSql(
            "insert into parts(nr,productid,description,toolsVerified) values(?,?,?,?)",
            [ nr, productId, desc, tool ],
            null, sqlError
        );
    
        // for cost table
        tx.executeSql(
            "insert into costs(nr,date,starttime,endtime,reason,cost) values (?,?,?,?,?,?)",
            [ nr, date, startTime, endTime, reason, cost ],
            null, sqlError
        );
    
        // for sign table
        tx.executeSql(
            'insert or replace into sign(orderNr,rapport,sign) values (?,?,?)'
            [nr, rapport, kundensUnderSkrift],
            null, sqlError
            );
    }, xactError);
    
    function sqlError(tx, err) {
        alert("Statement failed: " + err.message);
    }
    
    function xactError(err) {
        alert("Transaction failed: " + err.message);
    }
    

提交回复
热议问题