Set search text box value programmatically

Kibana version :5.6.4

I need to set the value of the search text box value in dashboard tab programmatically. I have a textbox and a button outside kibana and once the user click the button, the value of the text box needs to be sent to the search textbox.
How can we achieve it ?

You can add any search as Url Parameter when opening the page:
https://myhost:5601/app/kibana#/dashboard/79ffd6e0-faa0-11e6-947f-177f697178b8?_a=(query:(language:lucene,query:'beat.name:"mySearchValue"'))

In the query you can define the conditions as required, then you can use this url in an iframe or similar...

Ya.. That works. But..
I have the kibana running in iframe and whenever the user changes the value of the text box and clicks the button, I will need to reload the iframe with the new url. I don't want to do that. I need just to pass the value to the search text box whenever the user changes the text box value and submits the button.