2

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

Mayank
  • 1,099
  • 4
  • 17
  • 44

1 Answers1

4

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 = "";
    }
}
NG_
  • 6,895
  • 7
  • 45
  • 67
Vignesh Vino
  • 1,242
  • 4
  • 25
  • 50