Martinus Posted October 4, 2022 Posted October 4, 2022 Hi PW's, I am trying to find out if there is such a thing as a simple contact form with validation etc. on PW. Right now I have a simple form using bootstrap but obvious - there is not really a good validation in it's framework. I could fill in whatever I want and it validates ok. I have looked in modules but there is so much and also many seem to be outdated (more then ten years back). I have tried to install frontendForms but was giving me errors after I placed the folder in my modules map and did a refresh. Any advice is welcome.
Stefanowitsch Posted October 4, 2022 Posted October 4, 2022 Which Bootstrap Version are you using? Since Bootstrap 4 there is a form validation component that you can use. It prevents submitting when required fields are empty (for example). https://getbootstrap.com/docs/4.6/components/forms/#validation https://getbootstrap.com/docs/5.1/forms/validation/ However this validation is frontend only. If you disable JavaScript you are still able to submit the form to the server. So I would advice you to make use of both frontend validation (Bootstrap) and backend validation (either via the processwire API or a third party PHP module (https://github.com/rakit/validation).
Martinus Posted October 4, 2022 Author Posted October 4, 2022 ok. I have bootstrap 5.2, and I know the validation of it only checks for empty fields. I still need PW validation at the back. Where do I find such examples? I have looks in the docs, api, and tutorials section (forum) but did not find any.
pwired Posted October 4, 2022 Posted October 4, 2022 Quote I still need PW validation at the back. Where do I find such examples? you will find all you need in this forum thread https://processwire.com/talk/topic/2089-create-simple-forms-using-api/ 1
zoeck Posted October 4, 2022 Posted October 4, 2022 There's also a paid pro module "FormBuilder": https://processwire.com/store/form-builder/ 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now