Only allow clipboard pasting, not typing, into a field.

I have a field where users should be pasting in content from another tool, and not directly entering information into a Textarea. Is there a way to control a field so the user cannot type into the Textarea, but can paste into it. Or is there a better method than using a Textarea to let the user throw stuff from the clipboard into the form?

OR

Is it possible to use a fileUpload, but instead of uploading the file to my storage, it just pulls the content of the (xml) file and fills in a readOnly field?
Solution
You would use the closure Get and Sets

->afterStateUpdated(function($state, $get, $set) { 
      $state  = your file  // do processing
      $fileData = Processes

      $set('my_field', $fileData);
     
})
Was this page helpful?