Forum Replies Created
- AuthorPosts
katw
ParticipantIt appears the custom validator ISN’T executed if the radio group field which the validator is attached to:
– IS NOT REQUIRED and
– has NO VALUE (empty).But this is the precise condition where I want the validator running. No radio button group value is handled within the custom validator… but it appears empty results in no custom validation.
hmmm
katw
ParticipantHave you tried adding to the css you just customised the CSS style:
font-style: normal;
katw
ParticipantIn your slider you have a button “Let’s Chat” it has a unique ID of ‘slide-88-layer-14’.
From what I see this covers the entire button area, text and background colour. So you are covered from UI “click-on” perspective.
This same DIV also appears to have a click event attached (guess it’s using functionality offered by the slider?) which is going to do an on-page jump down to an anchor in the page called #form-3.
I don’t have experience with QuForm popup code so I can’t critique or advise on Ally’s code, except to explain it is also adding a click event to the “slide-88-layer-14” (if you fix the number from 10 in her example to 14 which is what your div is using).
I can’t say I understand the logic of ‘false’ to toggle view of the popup “.iphorm-fancybox-link-3”. But don’t take this comment as a concern more a lack of understanding of the popup behaviour.
The only thing nagging in my mind about the solution offered is the behaviour of the two “CLICK” events. Are they both running? Does it jump down? And then has it tried to open the popup and failed?
You could add a temporary Alert message to tell you her code is being run and remove it when not needed. Like so:
jQuery(function ($) { $('#slide-88-layer-14').click(function () { // We are here, tell the world alert ("triggered Ally's click function, Yay!"); $('.iphorm-fancybox-link-3').click(); return false; }); });
That’s all for me. All the best
- This reply was modified 6 years, 11 months ago by
katw. Reason: Fixed ID reference to the one Daniel is using in his page
katw
ParticipantFound I should also add my new filter definition to
function getFilters()
katw
ParticipantDaniel,
Thought I might be able to help, so took a very quick look at your page too.
From debugger view the <Script> code Ally gave you has been wrapped inside a <p> tag.
I don’t know what weird behaviour that would cause (apart from it not being correct) but see if you can pull it out of the text flow as it is a script not HTML content.
Also I don’t understand the logic of attaching a click event to an hyperlink? In ally’s example she was attaching the event to the button text which is the “lets chat” trigger button.
For using her example you would need to change ‘#slide-88-layer-10’ reference to ‘slide-88-layer-14’ as this is the ID of the button text “Chat” inside the slider at top.
Attachments:
You must be logged in to view attached files.May 1, 2018 at 10:11 pm in reply to: Preventing Submission – spammers trying to sell me viagra #25405katw
Participant@pinkcaviar “A useful word list” would be a great help for many of us.
As would having a “global” blacklist settings option for Quform.
An addition for a future release?
katw
ParticipantI tried to create a new PHP filter for uppercase first letter.
I modelled the code on your TRIM example and uploaded the new filter to the QUFORM > FILTERS directory.
Unfortunately it didn’t work.
Am guessing an Initialisation routine knows about the filters installed and didn’t like my addition. Or I have missed doing an important step.
You probably don’t want to help with this solution as I am modifying your install files (which makes it problematic for me at time of upgrading).
BUT if you did want to help here is the code I added to a file called UpperFirstLetter.PHP
<?php /** * @copyright Copyright (c)2018 ThemeCatcher */ class Quform_Filter_UpperFirstLetter extends Quform_Filter_Abstract { /** * Makes first letter of value uppercase * * If the value provided is not a string, the value will remain unfiltered * * @param string $value The value to filter * @return string The filtered value */ public function filter($value) { if ( ! is_string($value)) { return $value; } return ucfirst($value); } public static function getDefaultConfig() { $config = apply_filters('quform_default_config_filter_UpperFirstLetter', array()); $config['type'] = 'UpperFirstLetter'; return $config; } }
katw
ParticipantDon’t worry, I will do this client side.
BTW might be worth adding these filters to future QuForm updates.
And publishing a “how to make your own filter” as you have done for custom validators.
Just an idea.
katw
ParticipantThanks will give it a try
katw
ParticipantAwesome that is fabulous.
BTW the validator allows spaces in the email address which is invalid I thought?
eg
“foo @bar” AND “foo@ bar” will pass as valid
April 16, 2018 at 1:45 am in reply to: Conditionally 'Required' fields – How to? JS solution needed #25003katw
ParticipantI see you add a ‘required’ CSS class to fields and don’t use ‘REQUIRED’ parameter on form fields.
Given this,
If I set the field as required in the settings and set it up as if it is always expected (ie set validators and error message text)
Then programatically remove the ‘required’ class… when it is not mandatory…
Will QuForm ‘On submit’ ignore the required settings and allow the form to go?
If so I have a solution I could use.
Please advise if above would work.. or provide a solution if possible.
April 15, 2018 at 1:30 am in reply to: Conditional logic not applied when value programatically changed (toggled) #24999katw
ParticipantThanks Ally, solution works.
Would love to see Quform V2 conditional logic section expanded to allow more complex logic including sub-logic.
Perhaps event triggers could be added for user choice too? Onchange, Onfocus, onclick etc
- This reply was modified 6 years, 11 months ago by
- AuthorPosts