libreform / wp-libre-form

Easy native HTML5 forms for WordPress. Version 1.5 is unmaintained, but works without issue. 2.0 has been rewritten from the ground, and can be found at https://github.com/libreform/libreform
https://wordpress.org/plugins/wp-libre-form
GNU General Public License v3.0
67 stars 27 forks source link

Add no-js fallback #64

Open timiwahalahti opened 7 years ago

timiwahalahti commented 7 years ago

Let's try this PR again with different branch.

As discussed in #50, this implements quite simple fallback to handler when submitting form without javascript. It can be turned on with filter.

Because some terms are reserved for WordPress core, this PR also implements check for those in fallback mode and shows error when using those terms as input names.

After successful form handling user is redirected to referrer page and thank you message is shown instead of form. When validation contains errors, message from validator is shown below form the same way as with javascript. Only downside is that inputs are cleared :/ But I think we can accept that, because browsers supports input checks quite widely. Can we?

Needs a bit more testing, updates to README and opinion about success/error handling.

anttiviljami commented 7 years ago

@timiwahalahti need help with this? codesniffer just doesn't like your tabs. :)

k1sul1 commented 6 years ago

@timiwahalahti got any time to fix this? Could be an useful feature for 1.5 :wink:

phpcbf should fix any tabs for you: ./vendor/bin/phpcbf --standard=./phpcs.xml .

timiwahalahti commented 6 years ago

I'll milestone this to 1.5 and fix this week.

timiwahalahti commented 5 years ago

I'll work with this next week.