• Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

79
Views
How to make sure that when entering the input, the "+" sign does not give out like this "% 2b"?

Here's how you can get rid of this so that the "+" sign is always displayed, and not incomprehensible characters? I don’t know how you can write the code for it to work normally

   const [isSearchOpen, setSearchOpen] = useState(false),
       formRef = useRef(null);
   useClickOutside(formRef, () => setSearchOpen(false));
   const [inputText, setInputText] = useState("");
   const handleSubmit = e => {
       if (inputText.length >= 150) {
           alert('Maximum length 150 characters ')
           e.preventDefault();
       }
   };


   return (
       <form
           ref={formRef}
           className={cn("search-form", {
               "search-form--focus": isSearchOpen,
           })}
           onClick={() => setSearchOpen(true)}
           onKeyPress={() => setSearchOpen(true)}
           action="/search"
           // eslint-disable-next-line
           role="searchbox"
           onSubmit={handleSubmit}
       >
           
           <input
               value={inputText}
               onChange={e => setInputText(e.target.value)}
               className="search-form__input"
               name="filter"
               type="text"
           
           />
         
           
           <button
               className="search-form__button"
               type="submit"
               aria-label="Header search button"
           />
       </form>
   );
};
9 months ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2023 PeakU Inc. All Rights Reserved.