Skip to content

Instantly share code, notes, and snippets.

@shanwixcode

shanwixcode/page.js

Created Jan 1, 2021
Embed
What would you like to do?
import {createSub} from 'backend/mailChimp';
$w.onReady(function () {
});
export function submit_click(event) {
if($w("#fName").valid && $w("#lName").valid && $w("#email").valid){
$w("#error").hide();
$w("#submit").disable();
createSub($w("#fName").value, $w("#lName").value, $w("#email").value)
.then( (res) => {
console.log(res);
if(res.status < 400){
console.log('SUCCESS');
}else{
$w("#error").text = 'Something went wrong';
$w("#error").show();
}
});
}else{
$w("#error").show();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment