Execute javascript function from text field

Hello,

I need to create a button next to other fields that executes a javascript function.
Is it possible?