☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

TextInput Callback not working

Community Support
SubhamSharma1996
SubhamSharma1996

TextInput Value is not being fetched by javascript call back the TextAreaInput is working fine and it is displaying the entered value in console on Tab click.
But i need the to fetch the TextInput Value also. Please help!

from bokeh.layouts import layout, column
from bokeh.models.widgets import Div
from bokeh.io import show
from bokeh.models import TextInput, CustomJS, TextAreaInput
from bokeh.io import output_file

ti = TextInput(title="ti")
callback = CustomJS(code="""
var f=cb_obj.value;
console.log("hello ti");
console.log(f);""")
ti.js_on_change("value", callback)

tia = TextAreaInput(title="tia")
callback = CustomJS(code="""
var f=cb_obj.value;
console.log("hello tia");
console.log(f);""")
tia.js_on_change("value", callback)

doc_layout = layout()
doc_layout.children.append(column(Div(text="""<h1>Hello World!</h1>""")))
doc_layout.children.append(ti)
doc_layout.children.append(tia)
output_file('TestInput.html', mode='inline')

show(doc_layout)
⌁   Link to post
p-himik
p-himik

Works just fine for me with Bokeh 2.0.2.
Note that js_on_change is triggered only when you hit Enter or when the input field loses focus. If you want to see updates for every key press then you should monitor the value_input attribute instead of value.

⌁   Link to post

End of archived discussion · Replies are disabled