I am trying to a check box in a form to output something like a 0 or 1 or Y and N, just something to tell me if it was checked or not.
<input type="checkbox" name="bridal" placeholder="Bridal" value="yes">
This is what I have as an example and no matter what I have done so for, it just says 'ON' in the SQLlite database.
Can anyone give me a bit of insite as to where I should be looking?
Thanks.
function insertDB(tx) {
var _full_name = $("[name='full_name']").val();
var _email = $("[name='email']").val();
var _bridal = $("[name='bridal']").val();
var _bridesmaids = $("[name='bridesmaids']").val();
var _flowergirls = $("[name='flowergirls']").val();
var _mens_hire = $("[name='mens_hire']").val();
var _accessories = $("[name='accessories']").val();
var sql = 'INSERT INTO DEMO (full_name, email, bridal, bridesmaids, flowergirls, mens_hire, accessories) VALUES (?,?,?,?,?,?,?)';
tx.executeSql(sql, [_full_name, _email, _bridal, _bridesmaids, _flowergirls, _mens_hire, _accessories], sucessQueryDB, errorCB);
}
<input type="checkbox" name="bridal" value="yes">and checked or unchecked its entering yes into the database.