Fix form submit
Signed-off-by: Egor Savkin <es@m-labs.hk>
This commit is contained in:
parent
d8bad3d7b4
commit
fcf0f49816
|
@ -346,7 +346,7 @@ button {
|
|||
outline: none;
|
||||
}
|
||||
|
||||
input[type="submit"],
|
||||
.order-form-submit,
|
||||
.btn-cla {
|
||||
/*background-color: $btn-primary-2;*/
|
||||
font-weight: 700;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -61,8 +61,9 @@ export function OrderForm() {
|
|||
<div className="d-flex flex-column flex-sm-row justify-content-between">
|
||||
<ShowJSON/>
|
||||
|
||||
<input className="btn btn-primary w-100 m-0 ms-sm-2" type="submit"
|
||||
<input className="btn btn-primary w-100 m-0 ms-sm-2 order-form-submit" type="button"
|
||||
disabled={submitDisabled()}
|
||||
onClick={submitForm}
|
||||
value={`${isProcessing ? 'Processing ...' : 'Request quote'}`}/>
|
||||
</div>
|
||||
{/*This will open an email window. Send the email to make your request.*/}
|
||||
|
|
|
@ -187,6 +187,12 @@ const useSubmitForm = ((set, get) => ({
|
|||
throw Error("Response status is not OK: " + response.status + ".\n" + response);
|
||||
}
|
||||
get().finishSubmitForm({status: Validation.OK, message: "We've received your request and will be in contact soon."})
|
||||
}, reason => {
|
||||
console.error("Request rejected, reason:", reason)
|
||||
get().finishSubmitForm({
|
||||
status: Validation.Invalid,
|
||||
message: "We cannot receive your request. Try using the export by coping the configuration and send it to us at sales@m-labs.hk"
|
||||
})
|
||||
}).catch(err => {
|
||||
console.error("Request failed, reason:", err)
|
||||
get().finishSubmitForm({
|
||||
|
|
Loading…
Reference in New Issue