Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

230
Views
¿Cómo agregar un parámetro en la acción del formulario html?

Tengo un formulario como este:

 <form action="studyresults.show" method="POST"> ... ... <div style="clear: both;float: right;padding-top: 15px;padding-bottom:5px;"> <input id="submitButton" style="float:right;margin-top:-80px;" type="submit" class="btn btn-primary" value="Add" /> </div>

Quiero agregar un parámetro de cadena de URL como este:

 <script> function getQueryStringValue (key) { return decodeURIComponent(window.location.search.replace(new RegExp("^(?:.*[&\\?]" + encodeURIComponent(key).replace(/[\.\+\*]/g, "\\$&") + "(?:\\=([^&]*))?)?.*$", "i"), "$1")); } </script>

Me gustaría consultar la URL con la cadena "token" para poder pasar "token" como parte del parámetro de solicitud POST cuando hago clic en el botón Enviar. ¿Cómo puedo conseguir esto?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Como está utilizando JSP, no es necesario involucrar JavaScript aquí. Puede extraer cualquier valor de parámetro de cadena de consulta directamente utilizando el lenguaje de expresión EL de JSP.

 <form action="studyresults.show" method="POST"> <input type="hidden" name="token" value="${param.token}" /> ... <div style="clear: both;float: right;padding-top: 15px;padding-bottom:5px;"> <input id="submitButton" style="float:right;margin-top:-80px;" type="submit" class="btn btn-primary" value="Add" /> </div> </form>

El ejemplo anterior agrega el valor del token ${param.token} como un campo <input> oculto que se publicará junto con otros valores de campo cuando se envíe el formulario.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!