Page 1 of 1

FIXED - Sending Blank Forms when using Layout Grid and Built-In Forms

Posted: Tue Sep 26, 2023 11:36 am
by Starb7
Hi All

I have been using standard PHP and mail scripts to send forms, along with the built-in validation toos and I can block most 'Submit' optionatiosn where the form is blank or incomplete.

I have used thew Built-In Forms (withing a layour grid) and all the field/object validations works as expected but I can can still send a form if it is blank. Is there a way to get to check the form (validation) when the Submit button is clicked to check that all fields have been completed?

I have had a look through the formum and the tutorials but can't find anything relevent to this topic so any guides would be great.

TIA

Cheers
Paul

Re: Sending Blank Forms when using Layout Grid and Built-In Forms

Posted: Tue Sep 26, 2023 12:25 pm
by BaconFries
Are you sure you have added validation to the form fields? please see the following Form Validation Can you please provide a url to the said page with the form so it can be viewed. Note if you are using any external scripts then it may not be possible to help.

Re: Sending Blank Forms when using Layout Grid and Built-In Forms

Posted: Tue Sep 26, 2023 12:34 pm
by Starb7
Hi BaconFries

Yes, I have validation on the fields, ie datatype, field lengths, etc. I even have a very simple challenge at the form footer that checks for a number being inserted. All of these are ignore and the form just sends. The form is here https://directgasltd.co.uk/contactus.php

I could add a recaptcha if that would help, just don't know why the form is not validating?

Cheers

Paul

Re: Sending Blank Forms when using Layout Grid and Built-In Forms

Posted: Tue Sep 26, 2023 1:15 pm
by Pablo
Did you also enable server sided validation in the advanced properties of the form?

Re: Sending Blank Forms when using Layout Grid and Built-In Forms

Posted: Tue Sep 26, 2023 1:19 pm
by Starb7
No, that isn't enabled and I haven't used that on any other forms. Should that be on and really default to on if it's needed? Cheers

Re: Sending Blank Forms when using Layout Grid and Built-In Forms

Posted: Tue Sep 26, 2023 1:31 pm
by Pablo
Standard form validation uses JavaScript, so if the user (or spammer) has disabled JavaScript then the validation will not work.
When server sided validation is enabled then the validation form cannot be skipped.

Re: Sending Blank Forms when using Layout Grid and Built-In Forms

Posted: Tue Sep 26, 2023 1:48 pm
by Starb7
This is a real testing option with nothing dissabled, ie Java is running, etc. I have enabled that option, uploaded the page and still get the same result, ie the validation is being ignored. Any othger pointers? Perhaps it might be worth redoing the form from scratch in case there is an issue there?

TIA

Cheers
Paul

Re: Sending Blank Forms when using Layout Grid and Built-In Forms

Posted: Tue Sep 26, 2023 2:02 pm
by Starb7
Just as a test, have created a new page MOVED - SEE BELOW with 2 fields and 1 button. Field 1 validates with 2 to 10 chars and Field 2 validates with 10 to 20 chars and this works just fine! No extra setting and no 'server side' options needed. Has to be a problem with th epage I think so looks like me recreating it :(

Just created a new folder an duploaded to that to keep the testing stuff separate, it's now here https://directgasltd.co.uk/formtest/formtest.php

UPDATE: Now this is really wierd! Once you have sent the email 'Submitted' copy the url, close the page then reopen the page with that copied url. Do you see the submitted values in the field? Why? I though that the 'Submit' buttom would send and then clear those and even a resfresh page is keeping the values! The plot thickens! FIXED - the Web Storage 'Use Web Storage to store form values between sessions' was enabled! Unticked and this part of the issue gone :)

Cheers

Re: Sending Blank Forms when using Layout Grid and Built-In Forms

Posted: Tue Sep 26, 2023 4:12 pm
by Starb7
Pablo wrote: Tue Sep 26, 2023 1:31 pm Standard form validation uses JavaScript, so if the user (or spammer) has disabled JavaScript then the validation will not work.
When server sided validation is enabled then the validation form cannot be skipped.
Just to address this part, i have added a second form on to the same page (perhaps not good practice) to test the validation. Just two fields, very simple and if you click 'Submit' with nothing in them, you get a warning as expected. This is just to elimiate the issue of Java and validation.

Struggling to find the answer to this and think it would be just as easy to start again with the page :(

Cheers

Re: Sending Blank Forms when using Layout Grid and Built-In Forms

Posted: Tue Sep 26, 2023 4:47 pm
by Pablo
There is an error in the JavaScript because one of the input field has an invalid ID.

Related FAQ:
viewtopic.php?t=64868

Re: Sending Blank Forms when using Layout Grid and Built-In Forms

Posted: Tue Sep 26, 2023 6:46 pm
by Starb7
Thanks Pablo. I suspect there's an issue in the form and was ready to redo it. I'll check the id's and see if I can find it.

Cheers
Paul

Re: Sending Blank Forms when using Layout Grid and Built-In Forms

Posted: Wed Sep 27, 2023 3:46 pm
by Starb7
Pablo wrote: Tue Sep 26, 2023 4:47 pm There is an error in the JavaScript because one of the input field has an invalid ID.

Related FAQ:
viewtopic.php?t=64868
Hi Pablo

I found the issue, a dash insertied instead of an underscore in one of the field ID's as you suspected. This has brought me to ask where exactly is the 'Error Report Tool' that I see refenced in the help pages? How do I run and view page/site 'errors'?

For anyone else looking - see the above link viewtopic.php?t=64868

Just asking, if all other characters are 'invalid' why allow them to be used in the Properties '(ID)' field? ;)

Cheers
Paul

Re: Sending Blank Forms when using Layout Grid and Built-In Forms

Posted: Wed Sep 27, 2023 4:56 pm
by Pablo
You can find Error Reports in the Page menu.
Just asking, if all other characters are 'invalid' why allow them to be used in the Properties '(ID)' field? ;)
This is to allow advanced users to use it without restrictions. For example, if you do not have any JavaScript features on the page then the use of dashes is valid.

Re: Sending Blank Forms when using Layout Grid and Built-In Forms

Posted: Wed Sep 27, 2023 5:09 pm
by Starb7
Thanks - I can look there for any other issues too.

Noted re the File Names and Java - makes sense :)

Cheers

Paul