Hello all,
I would like to include a link to a modal in the validation message of an input.
How can I do this?
The situation is as follows:
The user has to complete a sign up form to create an account.
If the username already exists, we now show a validation message under the username input "Username already exists, please choose another one".
We now want to enrich this validation message with "or if you forgot your password, please reset it here".
This last sentence should be a link to the modal we have to reset your password.
How can I achieve this?
Thanks for your help!
Hi @Gerrit van Dalen ,
you could have a custom made widget right under your input with the ValidationMessage class, and when you detect a name that is already used, instead of filling the ValidationMessage property of the widget, only set the Valid property of the widget to False, leave the ValidationMessage empty, and set a boolean to show this custom widget.
If Valid is set and ValidationMessage is not, no space is taken by ValidationMessage, so the custom widget will look the same as the normal validation message.
See attached oml for an example. You'll have to make sure to handle the visibility (i.e. reset it) correctly in all scenarios to mimic what happens to the built-in validation message.
Dorine
Hello,
I don't think you can give link to the validation message.
However, You can do it by controlling the visibility of the link on the Input widget's validation. If the If it is not valid make it visible and vice versa.
Hi Gerrit,
You can send sample oml file so that anyone can make changes in that file.
And its very simple , Google is our friend if you search it you will easily get multiple answers for the same.
Thanks,
Ajit Kurane.