Reputation: 1139
I have designed a login page in QML for my app on BB10.
In the username field I want to perform the email-id format validation.
How can I accomplish this ?
thanks
Upvotes: 2
Views: 2768
Reputation: 1238
To enter email and password we add two TextField
in the CommonDialog
.
You can try with this code
TextField {
id: textFieldEmail
width: contentColumn.width - textEmail.font.pixelSize*5
echoMode: TextInput.Normal
errorHighlight:false;
placeholderText: qsTr( "Enter email" )
anchors.left: parent.left
anchors.leftMargin:textEmail.font.pixelSize*5
validator: RegExpValidator { regExp:/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/ }
onTextChanged: {
textError.state ="hide";
textError.text = "";
}
}
Upvotes: 4