Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

142
Vistas
Javascript posting form with new line and unicode characters

I would appreciate some help with this. I am using Javascript to create a form element on the fly which contains a text input, assign a string to it's value and then submit it to a WEB API method which will accept a FormDataCollection. I am not using JQuery or any other library, I need to post it this way, since the API will return a file and this method was the only one that prompted user to open the file. It works, however new line characters are removed from the file(I also used textarea it didn't help), and also unicode characters are not displayed correctly (for example I get fianc� when input is fiancé (I tried setting the char set to UAT-8, didn't help either), this is the code, thanks a lot for your time!

     var mapForm = document.createElement("form");
mapForm.character_set = "utf-8";
            mapForm.target ="_self"||"_blank";
            mapForm.id="stmtForm";
            mapForm.method = "POST";
            mapForm.action = "http://blahblahblah;          
            var mapInput = document.createElement("input");
            mapInput.type = "Textarea";
            mapInput.name = "psResult";
            mapInput.value = psResult;
            mapForm.appendChild(mapInput);
            document.body.appendChild(mapForm);
    
            mapForm.submit();
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda