Not able return message

i have created one backend code with return message while onclick event fire. In page code when i try to call that function on button onclick but it does not show any message in preview time
My backend code is
export function btnclick()
{
return “Thank you for filling the form”;
}
in page code how to display the same please help me

Hi Parthasarathi Sarathi,

Sounds like you are on the right track.
Have you exposed your function from a Web Method? this is mandatory if you wish to call it from page code.

Also, you can use the $w api to change the label of your button:

Hope this helps.
Idan.