Endless validation issues with multi-step form

I am getting seriously frustrated with the validation for my Muti-step form. none of the rules that needed dynamic attributes were working on submit. i’ve had to scrap all of these because after endless posts I have had no solution. Even with these removed it still won’t submit and the console shows an error for the declaration check box even though it is clearly checked as shown on screen shot.

It has a simple ‘required’ validation rule.

The error you see in your browser console is coming from the server-side validation, not the client-side one. I.e. the validation rule applied to the POST variable for this input in your server action. And most probably this is caused by the fact your input has no value …

Also you can remove the server-side validation for your inputs and add them later if needed.

OK hands up to that one… @Teodor can you tell me do I have to re-import the form in the input properties every time I make an adjustment to the markup or validation?

Not sure what do you mean exactly? What do you need to reimport and why?

ok well the reason I ask is because I have been removing some of the validation rules because I haven’t been able to get them to work. I then click on the same field from the $_POST drop down in the workflow API and they show from there that they have validation rule still. As in screen shots.

I just feel like i’m getting in a complete muddle with what should be a relatively simple task.

Just remove the server side validations you don’t need after importing your inputs … there is no need to re-import the inputs every time you change anything on the page, as long as this does not involve adding new fields.

right ok thanks. another related issue is with trying to re-create the inline flows for the next button to validate each step. After converting the click event to a flow and then entering as you said in a previous post. It now doesn’t let me save the flow giving a warning message saying I need to enter at least one step!

Just invert the condition so it evaluates to true and move the setvalue there, so no need of else step.

So your condition becomes
from

inputName.invalid && inputName2.invalid

to

!inputName.invalid && !inputName2.invalid

also, please keep different issues in different topics.

@Teodor This is really confusing. Firstly I don’t understand exactly how to ‘invert the condition so it evaluates to true and move the setvalue there’ and why now is it I don’t need the else step where as before you explained to me to put the setvalue in the else step.

Check my code example please …

yes I can see your code example. But how does that show me how to perform what you are saying in the wappler interface. Do I need to add this manually? none of what you are now explaining to me was mentioned when you first showed me adding an inline flow to the next button for this to work.

Well you can do this when entering the expressions in the condition …

Ok @Teodor I’ve tried this, but i must have got it wrong somewhere. I’ve set up the inline flow on a next button and now the next button still works with validation errors.

Whats wrong here? See screen shots

Thanks in advance!

Looking at your condition maybe you want to change || to && as you want input1 not invalid AND input2 not invalid AND input3 NOT invalid etc.
|| means OR, but you need AND.

Also it’s better to paste your code instead of screenshotting it.

Ok thanks. will do

@Teodor because the operators are all now AND / && … If all fields are empty the next button still works. It only disables if some some fields are populated and some are empty. What I don’t understand is when I first set up a inline flow I was using OR / || operators for each value and the setValue in ELSE and they were working.

You were using OR because the condition you needed then was OR - input1 invalid OR input2 invalid OR input3 invalid.
Now you need to check if input1 not invalid AND input2 not invalid AND input3 not invalid.

OK that makes sense so how do I now prevent the next button from working if ALL validated fields are empty?

Well … when they are empty, are you sure they are invalid? Have you set required for them?