-
Notifications
You must be signed in to change notification settings - Fork 582
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
"Selected" not set for select_field #2226
Comments
<select class="input" name="status"><option value="disabled">Disabled</option><option value="enabled">Enabled</option><option value="test">TEST</option></select>
<select class="input" name="hookScript"><option value="disabled">Disabled</option><option selected="" value="enabled">Enabled</option></select>``` |
disclaimer, we both work on same project Brian Read and I : SME Server. from reading more the documentation, what was not obvious is that param is not a good choice to use while it is the one suggested in the doc https://docs.mojolicious.org/Mojolicious/Plugin/TagHelpers . from Mojolicious/Controller#param from Mojolicious/Controller#stash while mojo.* stash values seem not to cause any conflict with any project trying to use the helper, some of the mentioned reserved terms are one we could expect to occur quite frequently in any project using Mojolicious.... status, path , app, data, format, layout,template, text ... are among them. so the doc is showing something that is likely not to work, whilenot directly stated on the helper documentation it might fail : My guess is that changing the behaviour of param is probably not something without risk, but probably providing an alternative as something part of the helper TagHelpers could be reasonable ? my code could be improved by someone else, but this could be an approach:
and in template:
also could need some more helpers for other type of field like : |
... this looks like it's missing a \ from before the @ ... it might just be from pasting into github though. |
Can someone explain why the hookScript field gets its default "selected" set according to the value indicated whereas the status field does not get a "selected" set,
{
"hookScript" => "enabled",
.....
"status" => "test",
}
The text was updated successfully, but these errors were encountered: