Server connect form validation error required keeps coming

Hey all,

All of a sudden two forms, that I haven’t touched recently have stopped working.

One presents a weird output, too, not the usual error of the server connect:

{"form":{"rec_id[agency_id][inputPositionTitle][inputPositionLocation][inputIndustry][input_placementDate][inputReviewTitle][inputReviewerFname][inputReviewerLname][inputReviewerLocation][inputReviewerCompanyName][inputReviewerEmail][selectReviewerType]":"This field is required."}}

Seems to be something related to form validation. (I’ve checked, removed, triple checked etc.) and nothing is incorrectly setup - and even on a form with no validations anymore - I get this.

Wondered if anyone else has experienced this?

Seems like you have this variable in the server action under $_POST and it has validation rules applied.

Hi Teodor. I wish that was the case - I’ve checked every field, checked all AC and SC validationd and in some cases deleted and created entirely new fields. These forms worked fine then stopped all of a sudden after updating Wappler. I’ll try again tomorrow but wanted to see if anyone else experienced this before I do a bug report.

The error comes from the server action, so it’s some post variable there which has a validation applied to it. It might be even not used in the steps but just exists under $_POST.

Do you actually have such a field in the form on the page?

Yes Teodor, of course.

I always use the global in server actions to pull in all of the forms exactly as they are from the actual form on the page itself.

Forms did work prior to 3.3.2 (that’s the only thing I can think of that changed) - and now all of a sudden they are throwing a strange error. I’m going to rebuild both forms affected entirely, hopefully it’s just an isolated issue that this fixes - and also hoping to avoid posting a bug report.

Hey Teodor, thought I’d update you - I scrapped and rebuilt both forms completely but ended up with the same issue on one of them.

It turns out that the form kept presenting the same error when I had a ‘required’ validation on a select field type. It didn’t matter if I selected, or did not select it - the error kept presenting regardless - so I just removed the need to validate that specific select field and it works now. Might be a small bug with that specific field type and require validation.

Well, are you sure your select field has values added to the options?

I think there is something wrong between the field name on your form and field name defined in server connect as input. There is a mis match.

You must have a pretty complex name when it ends up like this with so many brackets.

You should really try to keep the name as a single name field.

Maybe you can post the html of the field.

If your problem is more generic you can post a sample form online so we can check it.

Yep, only 4 options and one selected by default, I’ve then tested leaving on the default, and also selecting one of the options.

The name of both the form, and the select input is basic, and I always, always make sure the ID and the Name are exactly the same. I then always pull through form fields using the global / import - I never write them myself.