SMS feature not working (Twilio)

Hi,

I´ve been trying to implement SMS to my website, but the code (although I get not error message) is not working. It seems like the button function is not working. If I run the code on the wix template, (https://www.wix.com/velo/example/twilio-sms-integration) it works perfectly, so not sure what I am doing wrong. Can someone help me?
And this is my page:
https://www.starkhr.com/message-candidate

Thanks!

Post you code please

Hi J.D. as requested:

import { sendMessage } from ‘backend/twilioService’ ;

$w . onReady ( function () {

$w ( '#sendButton' ). onClick (() => { 
    **if**  ( validateForm ()) { 
        **const**  toPhone  =  $w ( '#toPhoneInput' ). value ; 
        **const**  message  =  $w ( '#messageInput' ). value ; 

        $w ( '#successMessage' ). hide (); 
        $w ( '#errorMessage' ). hide (); 
        sendMessage ( toPhone ,  message ). then (() => { 
            $w ( '#successMessage' ). show (); 
        }). **catch** (() => { 
            $w ( '#errorMessage' ). show (); 
        }) 
    }  **else**  { 
        updateFormValidation (); 
    } 
}); 

});

function validateForm ( ) {
return $w ( ‘#toPhoneInput’ ). valid && $w ( ‘#messageInput’ ). valid ;
}

function updateFormValidation ( ) {
$w ( ‘#toPhoneInput’ ). updateValidityIndication ();
$w ( ‘#messageInput’ ). updateValidityIndication ();
}

Post your backend code as well

Hi J.D. it´s working perfectly now. Probably some glitch, thank you anyway!