what's the proper method of customizing placeholder text in the search field?
Posted: Wed Aug 23, 2023 10:53 am
Since I want to tell users to split Chinese keywords with more than 3 words into several parts, for example, split 数据库操作 to 数据 库 操作, so I'm trying to add a custom prompt text in the search field of webhelp. My guess is to modify the placeholder text for the input element of class wh_search_textfield.
For example,
<div class=" wh_search_input "><form id="searchForm" method="get" role="search" action="search.html"><div><input type="search" placeholder="为什么啊 为什么 " class="wh_search_textfield" id="textToSearch" name="searchQuery" aria-label="搜索查询" required="required"><button type="submit" class="wh_search_button" aria-label="搜索"><span class="search_input_text">搜索</span></button></div></form></div>
Note that I used the search-in-header template (https://github.com/oxygenxml/oxygen-pub ... -in-header), so I added the preceding div scripts to the move-search-in-header.xsl. see attached.
But insert the div scripts to here doesn't work at all:
Because in the output I have the following layout:
So which file should I modify to customize the placeholder text in a search field?
Thank you!
For example,
<div class=" wh_search_input "><form id="searchForm" method="get" role="search" action="search.html"><div><input type="search" placeholder="为什么啊 为什么 " class="wh_search_textfield" id="textToSearch" name="searchQuery" aria-label="搜索查询" required="required"><button type="submit" class="wh_search_button" aria-label="搜索"><span class="search_input_text">搜索</span></button></div></form></div>
Note that I used the search-in-header template (https://github.com/oxygenxml/oxygen-pub ... -in-header), so I added the preceding div scripts to the move-search-in-header.xsl. see attached.
But insert the div scripts to here doesn't work at all:
Because in the output I have the following layout:
So which file should I modify to customize the placeholder text in a search field?
Thank you!