I am having a timing issue while trying to validate portions of my web form in Sqlite. \[code\]function submitForm(){ var isValid = validateK2(); if(isValid) submitK2();}function validateK2(){ db.transaction(function(tx){ tx.executeSql("Select * From K2", [], function(tx, result){ if (results meet my criteria) return true; else return false; }, onSqlError); });}\[/code\]But at the time that the if (isValid...) code is executing, it is returning undefined because the validateK2 function has not finished executing and therefore has not yet returned true or false. What am I missing here?