Long story short: I am a lowly wage slave at a megacorporate entity you've definitely heard of and I don't want to risk getting in trouble by naming ;) (our HR can be.... aggressive about such things)
They made a form for us to use for a fairly common issue that arises at work - which winds up taking 20+ minutes when about 5 of that tops is spent figuring out or typing out what information to submit and the rest is due to the form's UI.
What I want to know is:
- Do they care if some of their elements are hidden via CSS, but other than that have not been tampered with beyond being sent click events and having text input values set by script and not typed by the user?
- I'm not sure what to do about unexpected form submit failures - I will validate the user inputs on my end, but if the form throws back some error anyway, it's gonna look pretty broken on a page that has had most of its UI hidden and replaced. Is there some easy way I can listen for a failed/rejected response so I can at least delete my new html elements and unhide the default ones so users can try to fix it themselves and won't be any worse off than if they hadn't used my code? Or perhaps just remember their entered values, reload the form entirely, and repopulate those without hiding anything or adding any new elements - just doing a couple element.clicks and element.value="blah" statements and letting the user take it from there? Or is there some super aggressive local JS detection that would allow those actions to seem to work but then block the form submission anyway?