When the form form submits data, keywords replaces the previous parameters.

such as the question: how to solve such a situation? Write a way to process keywords before submission and then splice it up?

Code:

<form acceptCharset="gbk" method="get" action="https:xxx_search.htm?product=true&tags=123" >
                <div className="searchBar">
                  <input className="searchVal" placeholder="" 
                  value={this.state.value} name="keywords"
                    onChange={event => {
                      this.setState({
                        value: event.target.value,
                      });
                    }} />
                  <button className="searchBtn" type="submit"></button>
                </div>
              </form>
Mar.30,2021

instead of default submission of form forms, submit asynchronously with fetch or axios

search(){
    const {value} = this.state;
    fetch(`https:xxx_search.htm?product=true&tags=123&keywords=${value}`).then(...)
}
render(){
    // ...
     <div className="searchBar">
        <input
            className="searchVal"
            placeholder="" 
            value={this.state.value} name="keywords"
            onChange={event => {
                this.setState({
                    value: event.target.value,
                });
            }} />
        <button className="searchBtn" onClick={this.search}></button>
    </div>
}


    <input type="hidden" name="product" value="true"/>
    <input type="hidden" name="tags" value="123"/>
    <input className="searchVal" placeholder="" 
                  value={this.state.value} name="keywords"
                    onChange={event => {
                      this.setState({
                        value: event.target.value,
                      });
                    }} />
</form>
Menu