submission error doesn't show when js is disabled
why this doesn't work with js disabled?
this is a "use server" action. form.result shows when js disabled but not form.error.
6 Replies
I could be completely wrong, but doesn't solid still need js to hydrate the server rendered content?
I remember seeing some examples with static generation, but I don't know how well that fits your use case
but even then I think if you to run without any js on client you have to go with classic http driven server that just sends resonses to requests, I dont know if you can do that in solid with just server side routing and I would think that means complete page fetching on each change which can work
this is a solid start form. its supposed to be progressively enhanced i.e. run without js
ah nice thats cool, didn't know worked like that
Can you also post your form or the complete component?
How do you validate / where does the error get thrown?
If you use a form library like ModularForms and schema validation (Zod, Valibot, Yup,....) you have to also parse the data in the actionm because without js there will be no validation otherwise.
I created a stackblitz, but unfortunately disabling JS on stackblitz does not work. But I tested the code on my local machine and the error is shown correctly.
Maybe you just need to update to the latest version of @solid/router?
https://stackblitz.com/edit/github-sdgul2-hvm2vc?file=src%2Froutes%2Findex.tsx
StackBlitz
Solid-start With Tailwindcss Example (forked) - StackBlitz
Run official live example code for Solid-start With Tailwindcss, created by Solidjs on StackBlitz