a!textField( label: "Title:", labelPosition: "JUSTIFIED", value: local!data.requestTitle, saveInto: {a!save(local!data.requestTitle, save!value) }, validations:( if(a!isNullOrEmpty(local!data.requestTitle), "Title is Required ", {}, )), refreshAfter: "KEYPRESS", characterLimit: 100, required: true, ), buttons: a!buttonLayout( primaryButtons: { a!buttonWidget_23r3( label: "Submit", style: "PRIMARY", submit: true, saveInto: { }, loadingIndicator: true(), validate: true(), ) }, secondaryButtons: { a!buttonWidget_23r3( label: "Cancel", style: "NORMAL", submit: true, validate: false, value: true, saveInto: ri!cancel ) } )
i added validation if title field is empty then validation should display saying "title is required" but the validation is not working in above code .can someone please help
Discussion posts and replies are publicly visible
Hello ZAINAB Why use validation if its just a null check. you can use required and a required message. unless you want to evaluate before submit.
I want to validate the textbox without clicking on submit button.The requirement is without clicking on submit button ,the validation message should be displayed under each field
I don't think that's an option. You will have to go with required parameter. Validations only work when you have a non null value to deal with.
You can disable the button until the fields are filled and display a message for users to understand why it is disabled.
Do I need a display message using section layout or is it possible to display message under the field its seem like how we get for required field?
You can display a message when the user hovers over the button. That message should tell them why they are not able to click the button and doing what will enable it. Example - Fill in the name to submit.