Getting Data on Real Time

I am trying to build a custom sms page for bulk sms. I am using ajax call for the process but I dont want the message content to be static.

For that i created a field named message. Now what I want is when i type message in message box and click on send sms to the group I selected, that message will be sent to that category.

But I’m having issue in passing the data written on the message box in ajax call as a variable.

Any help or tutorial docs will be appreciated.

Thank You

Try to see the custom page in frappe app like background_jobs to understand how they pass form values.