Forum Replies Created
- AuthorPosts
katw
ParticipantI re-activated “Validate submitted value” on the radio group field AND added your function to change the $validator:
add_filter('quform_entry_pre_process_1', function (array $result, Quform_Form $form) { $propstatus = $form->getElement('quform_1_31');//property status radio group if ($propstatus) { $validator = $propstatus->getValidator('inArray'); if ($validator) { $haystack = $validator->config('haystack'); $haystack[] = 'Query';// <---- NEW VALUE as set in quform_post_set_form_values_1(function) $validator->setConfig('haystack', $haystack); } } return $result; }, 10, 2);
On submit I get the validation fail, outside range notice
"This value is not valid"
The
quform_entry_pre_process_X
hook isn’t executed.BTW I changed your “InArray” string to “inArray”. May be semantics or may be important ?
Note I am using the
quform_post_set_form_values
hook to set the out-of-range option value.katw
ParticipantThanks good to know.
What happens if you are adding multiples? Is the ID treated as a string?
So you could use “00”, “000” for any extra options you want to create?
Or would it be better to assert an ID in high number range?
August 3, 2018 at 12:48 am in reply to: add_filter('quform_get_value_html') funct skipped when field empty & listEntry #26500katw
ParticipantOops, too soon.
Another request … the ability to change the field label for listEntry data column header (so we can shorten for better fit).
BTW HIDDEN FIELDS cannot have an admin label assigned.
I know they are ‘hidden’ so their label doesn’t show, so by default the label is ADMIN in nature.
What I am really saying is the viewing context affects the label descriptor needed.
In tabular listview I need an abbrev label and in other situations the existing admin or normal label descriptor may suit.
I don’t suppose we could have hooks like “quform_get_value_label_#_##” added so we can tweak the field label to suit the config:environment?
- This reply was modified 6 years, 9 months ago by
katw. Reason: Corrections
katw
ParticipantI have confirmed from testing the post_set_form_values hook is subject to validation.
So setting a field value outside those options prescribed will result in an error “Not a valid value” on submit.
So this hook requires one of the values prescribed if “Validate submitted value” is active in field options.
I will experiment with your suggestions. Thanks Ally
Question 3:
What does the parameter
'id' => 0
do in your addOptions() function?Does it define position order? Is it a unique id reference?
I had a quick look at the function reference in Multi.php but couldn’t see how ID was applied there.
- This reply was modified 6 years, 9 months ago by
katw. Reason: Add followup query
August 2, 2018 at 12:54 pm in reply to: add_filter('quform_get_value_html') funct skipped when field empty & listEntry #26496katw
ParticipantMany thanks.
Close ticket
August 2, 2018 at 11:55 am in reply to: No field label prevents display of Tooltip AND Required '*' marker #26487katw
ParticipantJust so you know…
An unwanted side-effect of the temporary solution/s is the visibility of the required marker ‘*’ and the tooltip hint text (not tooltip icon) in Edit Entry view.
Creating a CSS Style to target both and hide them can be used.
August 2, 2018 at 11:11 am in reply to: add_filter('quform_get_value_html') funct skipped when field empty & listEntry #26485katw
ParticipantAnother request for future updates is the ability to change the field label for listEntry data column header (so we can shorten for better fit).
And style tweak for the top alignment of data column header field labels; for when labels wrap over multiple lines.
Thanks
August 2, 2018 at 10:52 am in reply to: add_filter('quform_get_value_html') funct skipped when field empty & listEntry #26483katw
ParticipantThe hook is running for empty values in viewEntry and frontend.
Would be great to have it run for listEntry too.
One for the next update please.
katw
ParticipantQuestion 2.
I assume QuForm doesn’t validate the value you assign to the field?
OR
Does it still honour the “Validate submitted value” setting on the form field advanced settings?
If YES = still checked THEN {
Can this new value be added to the option value array?
So that the change is accepted AND EditEntry mode now shows the expanded set of radio button options for editing the entry?
}
If NO = not checked THEN {
What happens with Edit Entry mode?
Will a new radio button option be added to the existing set and be selected?
}
WHY? I may like to add a new option value to the values defined to make it stand out as a “non answer”.
August 2, 2018 at 8:23 am in reply to: No field label prevents display of Tooltip AND Required '*' marker #26481katw
ParticipantShould the options label (which now contains HTML markup) be URL encoded or will this be handled?
BTW my checkbox label is now 460 characters long.
So use of a text-editor is a must for tweaking the label content before posting in form builder UI field
August 2, 2018 at 8:16 am in reply to: No field label prevents display of Tooltip AND Required '*' marker #26480katw
ParticipantNice temp fix. But not a long-term one as tooltip text is disconnected from the form builder UI so makes tooltip text maintenance tricky for non-dev users.
I will give some thought to approaches and share the ideas with you. May be in a few weeks though.
Thanks for giving it thought.
katw
ParticipantDoes the
post_set_form_values
hook run after the form has successfully passed validation?
So I can trust the data within the field?
Thanks
katw
ParticipantThanks, that makes the solution super useful.
katw
ParticipantThat’s neat, thanks.
Close ticket
katw
ParticipantHi Ally,
Like the suggestion.
If I understand the code correctly you are creating a new option called ‘quform_serial_number’ and will be incrementing its value after every form post. Correct?
Just wondering what happens to this on plugin uninstall. From What I understand all options and keys are removed if the plug-in is uninstalled.
Isn’t this like form data. We want to protect this value when doing a plugin purge/reinstall process?
- This reply was modified 6 years, 9 months ago by
- AuthorPosts