0

<!DOCTYPE html>

<html>
    <form action="https://translate.google.com/" method="get" onSubmit="return validateForm()">

        Message: <textarea id="message" name="text" rows="3" cols="20" placeholder="Hello 202109"></textarea>
        <span id="messageError"></span>
        <br/><br/>
      
        Source language: <select name="sl" id="sl">
            <option value="en" selected>English</option>
            <option value="zh-CN">Chinese</option>
            <option value="ms">Malay</option>
            <option value="ja">Japanese</option>
            <option value="ko" >Korean</option>
        </select>
        </br>
        Target language: 
        </br>
        <input type="radio" id="tl" name="tl" value="en">
        <label for="rEng">English</label>
        </br>
        <input type="radio" id="tl" name="tl" value="zh-CN">
        <label for="rChi">Chinese</label>
        <br>  
        <input type="radio" id="tl" name="tl" value="ms">
        <label for="rMal">Malay</label>
        <br>
        <input type="radio" id="tl" name="tl" value="ja">
        <label for="rJap">Japanese</label>
        <br>
        <input type="radio" id="tl" name="tl" value="ko" checked>
        <label for="rKor">Korean</label>
        </br></br>
        <input type="submit" value="Submit">
        <input type="reset" value="Reset">

    </form>

    </body>
</html>

I have a simple html form that allows me to translate languages, so now currently I have a textarea and whatever language i type in it for example korean characters its suppose to send those character through my get request form to google translate. The problem is that when my request reaches google all the korean characters i typed in have been encoded to different # and numbers.

How do i get my form to be able to send this special languages without it changing.

Message: <textarea id="message" name="text" rows="3" cols="20" ></textarea>

Source language: <select name="sl" id="sl">
            <option value="en" selected>English</option>
            <option value="zh-CN">Chinese</option>
            <option value="ms">Malay</option>
            <option value="ja">Japanese</option>
            <option value="ko" >Korean</option>
        </select>
        </br>
Target language: 
        </br>
        <input type="radio" id="tl" name="tl" value="en">
        <label for="rEng">English</label>
        </br>
        <input type="radio" id="tl" name="tl" value="zh-CN">
        <label for="rChi">Chinese</label>
        <br>  
        <input type="radio" id="tl" name="tl" value="ms">
        <label for="rMal">Malay</label>
        <br>
        <input type="radio" id="tl" name="tl" value="ja">
        <label for="rJap">Japanese</label>
        <br>
        <input type="radio" id="tl" name="tl" value="ko" checked>
        <label for="rKor">Korean</label>
        </br></br>
        <input type="submit" value="Submit">
Best Jeanist
  • 1,085
  • 2
  • 12
  • 28
  • 1
    Would you mind to put your full HTML code into jsbin or codesandbox? That would be helpful for us to help you figured out. – Rohman HM Oct 04 '21 at 07:05

0 Answers0