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

124
Views
El host local del servidor WAMP no permite que el código JavaScript sea funcional

Lo siento de antemano si esta pregunta es confusa, pero soy muy nuevo en el diseño web.

Así que descargué el servidor WAMP para crear un sitio web y hasta ahora he tenido mucho éxito con la creación de archivos .php y .css para interactuar con la base de datos MySQL que he creado. Sin embargo, cuando intento agregar código JavaScript a mis archivos php, no sucede nada nuevo cuando abro esos archivos en el navegador usando http://localhost/myFile.php

Aquí tengo un ejemplo de intentar reescribir completamente el cuadro de texto que aparece cuando la entrada de mi formulario es un patrón no válido

php

 <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="style.css"> <script type="text/javascript" src="testJS.js"></script> <title>Search</title> </head> <body> <header>Enter Quote Number</header> <form action="qSearchResults.php" method="post" > <input type="text" name="salesman" id="salesman" maxlength="2" minlength="2" placeholder="01" required="" pattern="[0-9]{2}"/> - <input type="text" name="year" id="year" maxlength="2" minlenght="2" placeholder="00" required="" pattern="[0-9]{2}"/> <input type="text" name="number" id="number" maxlength="4" minlength="4" placeholder="0002" required="" pattern="[0-9]{4}"/> <input type="text" name="revision" maxlength="1" placeholder="A" pattern="[A-Za-z]"/> <input type="submit" value="Search" onclick="this.form.target='_blank';return true;"/> </form> </body> </html>

JS

 var salesmanInput = document.getElementById('salesman'); salesmanInput.oninvalid = function(event){ event.target.setCustomValidity('Salesman number should be a two digit number, even if the first digit is 0'); }

en este punto, no estoy seguro de si el problema es mi código JavaScript en sí, una configuración que necesito cambiar con el servidor wamp o una falta de comprensión de mi parte sobre cómo php del lado del servidor y JS del lado del cliente les permite interactuar en mi servidor local

Cualquier ayuda aquí sería muy apreciada, y estaré más que feliz de proporcionarles cualquier otra cosa que puedan necesitar para ayudarme a resolver esto.

about 4 years ago · Juan Pablo Isaza
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!