-
Notifications
You must be signed in to change notification settings - Fork 21
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
Required attribute missing in form #83
Comments
The required attribute is handled in the input itself. The required parameter is also available in the field.twig (/craft/plugins/amforms/templates/_display/field.twig). It has nothing to do with the fact that you're not using the default form.twig, but instead use one of your own templates. So I'm guessing the JS you're using is removing the attributes from the fields. Which version are you using though? |
I saw the required attribute in the field.twig, but I didn't modify this template. When I completely disable the JS it still doesn't add the required attributes. The version we are using is: 1.4.3 Do you have any other suggestions? |
The default templates should work just fine. Unless you overwritten one from an older version, or some JS is removing these attributes.. otherwise, this should not happen and I can't really reproduce this at the moment. Please check what's happening on your end and if you have any more info (when it really is a plugin bug) to help out reproducing it, that would be appreciated. |
Thanks for your response. I'll try to reset the modified files to see if the required attribute is added to the fields. If the problem still exists, I'll try to provide some information about how to re-produce the problem. |
Same problem here, making a field required in the CP doesn't add the required attribute to the input (or add an '*' to the label for that matter). It would be nice to have a required attribute, so we can add some real-time validation on the required fields with javascript/html5 form validation. This is with no javascript or custom templates. Example output: <input class="text nicetext fullwidth" type="text" id="form_v6dFvIkSIF-fields-naam" name="form_v6dFvIkSIF[fields][naam]" value="" data-show-chars-left="" autocomplete="off" placeholder=""> |
Hi, It is still not working, I'm digging into the plugin. When I add the required attribute to the following code in:
The required-attribute is appended to the config variable, but this attribute is missing in the settings value so this value is not parsed. Can u have a look into this? |
I got the same issue. What's the status of this problem? |
Same here, required comes through as FALSE in the template despite the forms settings |
I'm also having this issue. What is the status? Would be great to see an example HTML fragment with a working 'required-field' setup example. |
Fixed in the latest release! |
Hi,
I'm creating custom JS-validation on the amforms, however all of a sudden my required attributes are missing on the form fields. Has anyone else had this problem?
I've copied the form-template from the plugin-directory:
/craft/plugins/amforms/templates/_display/form.twig
and targeted it through the backend as the custom-form-template on 1 specific form. The only thing I've changed inside this template is that I've added 2 custom hidden inputs for handling my custom JS-validation, the rest is original.
Hope to hear from anyone soon! 😄
The text was updated successfully, but these errors were encountered: