for example the jQuery should fire up whereby the patient details should not be visible when the page is reloaded or refreshed. I got a feeling there are some issues with the import statement as it is showing this error msg " [Package Error] “fs” does not exist. (Imported by “twilio”)." from the developer tools.
$(document).ready(function(){
$('#patientDetails').addClass('patient-details');
$('.patient-details').css('display', 'none');
});
if (nricFinValue.length !== 9) {
alert("Invalid NRIC/FIN value.");
}
//}); to insert when database is done up
else{ //to change to if nricFin is not in database
alert("Not an existing patient. Need to create a new patient record.");
//}
$('.patient-details').css('display', 'block');
}
To really use Twilio you will need a backend to act as a proxy to make the actual calls to Twilio API. You never want to expose your API keys/tokens via the client.
Just FYI, CodePen is more of a service to create shareable web UIs. It’s not made for hosting full-blown projects like what you’re trying to achieve. You’ll likely want to look into setting up a Node environment on your computer.