Skip to content
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

[4.0] Buttons not rendered #368

Open
mikebi42 opened this issue Aug 24, 2019 · 12 comments
Open

[4.0] Buttons not rendered #368

mikebi42 opened this issue Aug 24, 2019 · 12 comments
Assignees

Comments

@mikebi42
Copy link

image
Same file works fine in form 3.0.7 but not 4.0.0-rc.1
image
Interesting that the button html seems to be surrounded by quotes.

@rhukster rhukster added the bug label Aug 24, 2019
@rhukster rhukster self-assigned this Aug 24, 2019
@rhukster rhukster changed the title Buttons not rendered [4.0] Buttons not rendered Aug 24, 2019
@rhukster rhukster added the 4.0 label Aug 24, 2019
@withindale
Copy link

withindale commented Aug 27, 2019

Same problem and please note the validation text is displayed as shown in the code blocks.

Contact TEST Form
*Required field
Name *
"Enter your name"
Email *
"Enter your email address"
<button type="submit" class="button " >Submit</button> <button type="reset" class="button " >Reset</button>

This test has fields copied from readme.md.

Our full contact form was also falling over on reCaptcha on our development site before the update to 4.0. That's why we have not updated our live site from Grav v1.6.9 - Admin v1.9.4.

Here is an example:

Contact Form
Required field
Subject *
Message *
Name *
Company *
Email *
Phone
Captcha *
<script> var captchaOnloadCallback_contact = function captchaOnloadCallback_contact() { grecaptcha.render('g-recaptcha-contact', { 'sitekey': "6LF....", 'callback': captchaValidatedCallback_contact, 'expired-callback': captchaExpiredCallback_contact }); }; var captchaValidatedCallback_contact = function captchaValidatedCallback_contact() {}; var captchaExpiredCallback_contact = function captchaExpiredCallback_contact() { grecaptcha.reset(); }; </script> <script src="https://www.google.com/recaptcha/api.js?onload=captchaOnloadCallback_contact&render=explicit&hl=&theme=light " async defer></script> <div class="g-recaptcha" id="g-recaptcha-contact"></div>
<button type="submit" class="button " >Send</button> <button type="reset" class="button " >Reset</button>

If it helps as a clue, a text field in a form with only one field did not show the validation text but the buttons did not display.

@rhukster
Copy link
Member

@khanmicro @withindale can you provide me with the page frontmatter that you use to define the form?

@mikebi42
Copy link
Author

mikebi42 commented Aug 27, 2019

https://learn.getgrav.org/16/forms/forms/example-form

Just used example, and simplified to just display message on submit. Also named it form.md

Sorry not at my computer right now.

@rhukster
Copy link
Member

OK, I think I must have fixed this already just not released... It works fine for me with latest form 4.0 branch. Can you please test?

monosnap-2019-08-27-11-01-48 image

@mikebi42
Copy link
Author

Downloaded the latest dev build from git hub, looks good. I would vote to make another development release so people can easily update.

@rhukster
Copy link
Member

Thanks, i'll get a new release out shortly.

@withindale
Copy link

withindale commented Aug 28, 2019

Still a problem here with the new release, sorry to say.

grav-en-grav_1_7_0-beta-5-admin_1_10_0-beta5

Above with Grav v1.7.0 beta 5, Admin v1.10.0 beta 5, Form v4.0.0-rc.3.

contact-supra-skeleton-grav-1_6_15-admin-1_9_9

Same form with Grav v1.6.15 - Admin v1.9.9, Form v3.0.8

`title: 'Contact SUPRA Form'
form:
    fields:
        name:
            type: text
            label: Name
            validate:
                required: true
                message: 'Please enter your name!'
        email:
            type: text
            label: Email
            validate:
                type: email
                required: true
                message: 'Please enter your email address!'
        subject:
            type: text
            label: Subject
            validate:
                required: true
                message: 'Please enter a subject for your message!'
        message:
            type: textarea
            label: Message
            validate:
                required: true
                min: 10
                message: 'Email message needs to be more than 10 characters long!'
    buttons:
        submit:
            type: submit
            value: 'Send Email'
    process:
        email:
            from: '{{ form.value.email }}'
            to: '{{ config.plugins.email.to }}'
            subject: '[Contact] {{ form.value.subject|raw }}'
            body: '{{ form.value.message }}<br /><br />{{ form.value.name }}<br />{{ form.value.email }}'
        message: 'Thank you from contacting us!'
        display: /form/thankyou`

@rhukster
Copy link
Member

Can you send me a zip of you beta test site? I can’t replicate this.

@rhukster rhukster reopened this Aug 28, 2019
@withindale
Copy link

withindale commented Aug 28, 2019

Yes, Let me see if the problem persists if I strip out the non-essentials first.

@withindale
Copy link

withindale commented Aug 28, 2019

I have emailed a download link for the stripped down version to contact@getgrav.org. For behavior see https://www.codeway.biz/grav-form/contact-test.

@rhukster
Copy link
Member

OK thanks for that @withindale. The issues were quite specific to Gantry because it disables auto-escaping by default. I think I have these sorted and committed to the 4.0 branch. Can you clone/download the latest version of this branch and replace your form plugin with it to test?

@withindale
Copy link

withindale commented Aug 28, 2019

Many thanks @rhukster. Now working after replacing the modified files in the form plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants