i want a message "fields cant be empty" to be displayed from my side that if i press the login button and my username or login is empty. Can anyone please help me out with this?

Hi Avneet,

Are you talking about Mobile or Web Apps? What login screen are you using, the standard one or did you create your own?

Do you know how to validate a Form?

Hi Kilian,


I am talking about web apps, i have used dublin theme and customized it, and i dont know how to put conditions on text field inputs.

Avneet Taneja wrote:

i want a message "fields cant be empty" to be displayed from my side that if i press the login button and my username or login is empty. Can anyone please help me out with this?


Hi,

Change the validation of button and if fields are mandatory then you will get required message.

Otherwise you can also use validation as suggested in training materials.

Please visit once.


Thanks

Set field as mandatory in data tab. See option Above:



If you want to change message shown for default login functionality , on click function of button perform null check fields empty. In Login action write check like below;




Let me know if you still need some help . Happy learning Outsystems :) 




Hi Avneet,

Like Jitendra hinted at, showing validation messages is standard OutSystems behaviour, explained in the training material. Be sure to understand the "Validation" Property of a Button, and the differences between "Server" validation and "Client  & Server" validation. Also understand the Valid runtime Property of an Edit Record or Form, and the Valid and ValidationMessage runtime Properties of Input widgets.

JitendraYadav wrote:

Avneet Taneja wrote:

i want a message "fields cant be empty" to be displayed from my side that if i press the login button and my username or login is empty. Can anyone please help me out with this?


Hi,

Change the validation of button and if fields are mandatory then you will get required message.

Otherwise you can also use validation as suggested in training materials.

Please visit once.


Thanks

Hi Jitendra,

I am not able to change the mandatory property because the username and password are entity  attributes defined by the system. So outsystems is not allowing me to have change that. Please have a look at the attachment, the problem is with login page, login button.


Avneet Taneja wrote:

JitendraYadav wrote:

Avneet Taneja wrote:

i want a message "fields cant be empty" to be displayed from my side that if i press the login button and my username or login is empty. Can anyone please help me out with this?


Hi,

Change the validation of button and if fields are mandatory then you will get required message.

Otherwise you can also use validation as suggested in training materials.

Please visit once.


Thanks

Hi Jitendra,

I am not able to change the mandatory property because the username and password are entity  attributes defined by the system. So outsystems is not allowing me to have change that. Please have a look at the attachment, the problem is with login page, login button.



Hi Avneet,

Based on your Module:

  1. Set the Validation Property of the Button to "Client & Server";
  2. Remove the "Confirmation Message"*.

*The Confirmation message is for confirmations, and shows the browser's confirmation pop-up, offering the user two buttons, "Yes" and "No". You shouldn't use it for messages that do not need a confirmation.

That should at least show the validation messages if one of the fields is left empty. Also, since you are redirecting to the original URL at the end of the login (as you should), the button could be Submit (instead of Ajax Submit), and the Ajax Refresh can be removed (as there's a redirect, the user can't see any refreshed screen parts anyway).


Kilian Hekhuis wrote:

Hi Avneet,

Based on your Module:

  1. Set the Validation Property of the Button to "Client & Server";
  2. Remove the "Confirmation Message"*.

*The Confirmation message is for confirmations, and shows the browser's confirmation pop-up, offering the user two buttons, "Yes" and "No". You shouldn't use it for messages that do not need a confirmation.

That should at least show the validation messages if one of the fields is left empty. Also, since you are redirecting to the original URL at the end of the login (as you should), the button could be Submit (instead of Ajax Submit), and the Ajax Refresh can be removed (as there's a redirect, the user can't see any refreshed screen parts anyway).


I did What you said but nothing is being displayed when i am clicking the sign in button with empty fields. Plus is it possible if one of the fields is empty then my cursor changes to a sign which shows no to actions(as in attachment) and the button becomes un-clickable.


Avneet Taneja wrote:

Kilian Hekhuis wrote:

Hi Avneet,

Based on your Module:

  1. Set the Validation Property of the Button to "Client & Server";
  2. Remove the "Confirmation Message"*.

*The Confirmation message is for confirmations, and shows the browser's confirmation pop-up, offering the user two buttons, "Yes" and "No". You shouldn't use it for messages that do not need a confirmation.

That should at least show the validation messages if one of the fields is left empty. Also, since you are redirecting to the original URL at the end of the login (as you should), the button could be Submit (instead of Ajax Submit), and the Ajax Refresh can be removed (as there's a redirect, the user can't see any refreshed screen parts anyway).


I did What you said but nothing is being displayed when i am clicking the sign in button with empty fields. Plus is it possible if one of the fields is empty then my cursor changes to a sign which shows no to actions(as in attachment) and the button becomes un-clickable.


You can perform edits in my module if you want kilian.


Avneet Taneja wrote:

Avneet Taneja wrote:

Kilian Hekhuis wrote:

Hi Avneet,

Based on your Module:

  1. Set the Validation Property of the Button to "Client & Server";
  2. Remove the "Confirmation Message"*.

*The Confirmation message is for confirmations, and shows the browser's confirmation pop-up, offering the user two buttons, "Yes" and "No". You shouldn't use it for messages that do not need a confirmation.

That should at least show the validation messages if one of the fields is left empty. Also, since you are redirecting to the original URL at the end of the login (as you should), the button could be Submit (instead of Ajax Submit), and the Ajax Refresh can be removed (as there's a redirect, the user can't see any refreshed screen parts anyway).


I did What you said but nothing is being displayed when i am clicking the sign in button with empty fields. Plus is it possible if one of the fields is empty then my cursor changes to a sign which shows no to actions(as in attachment) and the button becomes un-clickable.


You can perform edits in my module if you want kilian.



this is the image i was talking about.

Hi Avneet,

In the CSS of your Login screen, there's this CSS:

.ValidationMessage{
    
    display: none;
}

That causes the message to never appear! Remove it and they appear. As for the button becoming unclickable, that might have something to do with the recaptcha. I hve attached a version without it, and with the changes I proposed, and it works as expected.

(Also, please use the "Quick Reply" instead of fully quoting everything, as the thread becomes pretty unreadable, thanks.)

Hi Kilian,

I removed the css, the only validation i am seeing is required field in red. Instead of that i want an error message to be displayed "fields cant be empty".

Hi Avneet,

I'm not sure how you want to display the error message? Using a FeedbackMessage? In that case, see attachment.

Solution

It just occured to me that it's probably better to set the Validation to "(none)" instead of "Server", in which case you can remove the Assign that sets the "Valid" Property of the Input Widgets.

Solution

Kilian Hekhuis wrote:

It just occured to me that it's probably better to set the Validation to "(none)" instead of "Server", in which case you can remove the Assign that sets the "Valid" Property of the Input Widgets.

Thanks a lot kilian


You're most welcome. Happy coding!