Fix form handler - remove demo mode fallback, send to ERPNext always
This commit is contained in:
parent
3ebb4fb081
commit
dd4d7ed217
1 changed files with 2 additions and 5 deletions
|
|
@ -37,11 +37,8 @@ async function submitForm(form, formId) {
|
||||||
alert('There was an error submitting your information. Please try again or contact us directly.');
|
alert('There was an error submitting your information. Please try again or contact us directly.');
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// Fallback for when the proxy isn't available (staging/demo mode)
|
console.error('Submission error:', err);
|
||||||
console.log('Proxy not available, saving locally:', data);
|
alert('Error submitting form. Please try again or contact us directly.');
|
||||||
localStorage.setItem('form_' + Date.now(), JSON.stringify(data));
|
|
||||||
alert('Thank you! Your information has been received. (Demo mode - data saved locally)');
|
|
||||||
form.reset();
|
|
||||||
} finally {
|
} finally {
|
||||||
submitBtn.disabled = false;
|
submitBtn.disabled = false;
|
||||||
submitBtn.textContent = 'Submit';
|
submitBtn.textContent = 'Submit';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue