mrackley / StratusForms

Lightweight InfoPath alternative for SharePoint 2007,2010,2013,2016,2019 and Office 365
82 stars 36 forks source link

Submit form error #35

Open btroop202 opened 6 years ago

btroop202 commented 6 years ago

When I submit the form, I have a div that shows, for processing so user knows it is doing something. Workes great unless StrtusFormsSubmit returns 'alert("Please fix form errors and re-submit!");' for the validateForm.

What is sent back to the js file and how would I catch it to hide the div so users can fix the form??

davidcfk commented 6 years ago

You could potentially just change the part that throws the alert, to incorporate the closing of the processing div. You may even wrap that into a function and then consequently be able to check if the function exists first before running it... just to be safer than trying to access an element that doesn't exist.

This does involve you to modify the library though, it's not a big deal if you're using it for a single project, so that's why I thought maybe wrap that into a function you always use to handle processing divs, and then check if it exists, before finally running it after that alert has been "OKed".

warwickbuilds commented 5 years ago

You can call the validate function separately before calling the submit. So you can capture issues and only progress to submit you get a successful result