Custom variable choice to populate textbox

Is it possible to make the choice from a ‘custom’ variable (i.e. a dropdown) populate a textbox variable?
I’m attempting to allow a user to enter a query into a textbox but allow them to prepopulate it from a list of preset choices before editing the textbox.
The textbox only seems to display the static text and does not pick up the variable from $preset