I am trying to build a text input field so that users can give values for API filter / query.
However, it seems that st.text_input (and also st.text_area) does not return special characters like “:”, for ex "dataField:eq=value" returns
"dataField
=value"
so loosing totally “:eq”
Is it somehow possible to get the value that is using some special characters?
Using HTML input?
The issue you’re encountering seems unusual. By default, st.text_input and st.text_area in Streamlit should handle special characters without any problems.
I looked at it more closely, and it seems that using st.write is the problem, it will not show all characters. Input text was ok when I just used print(), please see code and output below
fq_text = st.text_input('filter or query')
if fq_text:
st.write('The current movie title is', fq_text)
print("FQ_TEXT: ", fq_text)
fq_area = st.text_area('filter or query')
if fq_area:
st.write('The current movie title is', fq_area)
print("FQ_AREA: ", fq_area)