Formulir

class Formulir(onValidated: (validated: Boolean) -> Unit)

Form validation class

Author

Jimly A.

Since

06-Jun-20.

Parameters

onValidated

method to do when Formulir validated or not

Constructors

Link copied to clipboard
fun Formulir(onValidated: (validated: Boolean) -> Unit)

create new instance of Formulir

Functions

Link copied to clipboard
fun addField(    fieldName: String,     view: View,     rules: List<BaseRule>,     action: (String) -> Unit? = null)

Method to add FormField

Link copied to clipboard
fun getFormValues(): HashMap<String, String>

Method to get values from fields by checking isValidated

Link copied to clipboard
fun runAllValidation()

method to run all validation from fieldList

Properties

Link copied to clipboard
var isValidated: Boolean = false

does the Formulir validated?

Sources

Link copied to clipboard