25.06

Version 1.1 by marissadiazpier on 2023/06/25 17:40

    /* Estilos CSS para la encuesta */
    .container {
      width: 400px;
      margin: 50px auto;
    }
  
    h1 {
      text-align: center;
    }
  
    form {
      margin-top: 20px;
    }
  
    label {
      display: block;
      margin-bottom: 10px;
      font-weight: bold;
    }
  
    input[type="radio"] {
      margin-right: 5px;
    }
  
    input[type="submit"] {
      margin-top: 10px;
    }
  

  

    

Encuesta

       

  

    function handleDocumentSaved(response) {
      console.log('Documento guardado con éxito:', response);
    }

    function saveResultsToOnlyOffice(results) {
      window.onEditorsReady = function() {
        window.Asc.documentService.upload(
          {
            url: 'https://drive.ebrains.eu/smart-link/58102a22-49fc-426b-ae8c-daa107489e58/',
            file: results,
            callbackUrl: 'https://callback-url-tu-aplicacion',
            token: '58102a22-49fc-426b-ae8c-daa107489e58',
            success: handleDocumentSaved,
            error: function(response) {
              console.log('Error al guardar el documento:', response);
            }
          }
        );
      };
    }

    document.getElementById('survey-form').addEventListener('submit', function(event) {
      event.preventDefault();

      var selectedOption = document.querySelector('input[name="option"]:checked').value;
      var results = "Has seleccionado: " + selectedOption;

      saveResultsToOnlyOffice(results);
    
     Puedes hacer más acciones aquí, como mostrar un mensaje de agradecimiento o redireccionar al usuario a otra página
    });
  
Public

SLU_HBPB