New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[form] unable to set default prompt for custom function #2976
Comments
The custom prompt has to be provided at type declaration rules: [
{
type : 'myrule',
prompt : function() {
return "custom prompt working!"
}
}
] |
Your other approach works too, but only if the central value is type of string (this is something we could improve to also accept functions here) $.fn.form.settings.prompt.myrule = "custom prompt working!"; |
understood, in my case the prompt is always generated so it needs to be function, for now it seems i will have to provide it each time with a type declaration may be in the future I'll implement pr, thanks ! |
I just did by #2977 😉 |
thank you so much ! |
Bug Report
when setting the default prompt (function) for a custom rule it triggers the error:
Uncaught TypeError: prompt.search is not a function
https://github.com/fomantic/Fomantic-UI/blob/develop/src/definitions/behaviors/form.js#L564
Steps to reproduce
set this defaults before instanciating a form
$.fn.form.settings.rules.mindate = function(value) {
return false;
};
$.fn.form.settings.prompt.mindate = function(v) {
return "custom prompt working!"
}
Expected result
no error
Actual result
Uncaught TypeError: prompt.search is not a function
Testcase
https://jsfiddle.net/0tsurydw/2/
Screenshot (if possible)
Version
2.9.3
The text was updated successfully, but these errors were encountered: