Closed Charlyo closed 8 years ago
Save it to a database of your choice.
Following the example: const form = { name: { q: 'Send me your name', error: 'sorry, wrong input', validator: (message, callback) => { if(message.text) { callback(true, message.text) //you must pass the result also return }
callback(false)
}
},
age: {
q: 'Send me your age',
error: 'sorry, wrong input',
validator: (message, callback) => {
if(message.text && IsNumeric(message.text)) {
callback(true, toInt(message.text))
return
}
callback(false)
}
}
}
$.runForm(form, (result) => { // * console.log(result) })
This last console.log, should show the user input in each question of the form. However, * never executes.
I think the problem in the validator function. IsNumber and toInt functions are not defined in js by default.
I understand that the console.log after the .runForm gives the input of the user response of the forms. However, no result is displayed...