jbonfardeci / ShockoutForms

SharePoint + Knockout MVVM forms - an InfoPath killer
32 stars 8 forks source link

Show error on same page #18

Closed leolorenzoluis closed 8 years ago

leolorenzoluis commented 8 years ago

Is it possible to show the errors not on the dialog but instead on the same form? Is there a way to decouple the modal dialog?

bnsc commented 8 years ago

in the ShockoutForms-1.0.6.js look to line 1304:

self.showDialog('<p>An error has occurred and the web administrator has been notified.</p><pre>' + err + '</pre>');

You can comment this line and the write logic to place the error on the page at your desired location. For example:

$('#error-div').innerhtml('<p>An error has occurred and the web administrator has been notified.</p><pre>' + err + '</pre>');

and you would need to add a div with an id=error-div to your html:

<div id="error-div"></div>

leolorenzoluis commented 8 years ago

Thank you! It works.