I need help with my app with BLE and Adrduino

I can send the “2” via pushing a button on my app to pulse for 500ms.

I would like to insert a text field instead of the button for pulse to type a 4 value that will be on the arduino. It would be 1234 in the text box (example) corresponding to 1234 for pulse on the arduino instead of just sending the “2” for pulse. if the user sends anything other than what is predetermined on the arduino such as 1234, nothing happens. So i would like to know how to input the text box and submit in place of the (new Uint8Array([2]) in this…

CONNECT

SWITCH ON

SWITCH OFF

PULSE ON/OFF

// Application object. var app = {} // Connected device. app.device = null; // Turn on LED. app.ledOn = function() { app.device && app.device.writeDataArray(new Uint8Array([1]), '0000ffe1-0000-1000-8000-00805f9b34fb'); } // Turn off LED. app.ledOff = function() { app.device && app.device.writeDataArray(new Uint8Array([0]), '0000ffe1-0000-1000-8000-00805f9b34fb'); } // Pulse LED. app.ledPulse = function() { app.device && app.device.writeDataArray(new Uint8Array([2]), '0000ffe1-0000-1000-8000-00805f9b34fb'); } Please help me. Please please please.