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

112
Views
Cómo obtengo el formulario de html a javascript

¿Cómo puedo obtener el valor de un formulario HTML para pasar a JavaScript y verificar el campo requerido pero el formulario y la verificación modal se requieren en una página HTML diferente?

página principal.html

 <html> <div ng-controller="mainController"> <button ng-click="action()">action</button> <div ng-include="formData.html'" ></div> </div> </html>

formData.html

 <html> <div ng-controller="formController"> <form name="form" role="form" novalidate="novalidate"> <div> <label for="name">Name</label> <div> <input ng-required="true" ng-model="data.name" id="name" name="name" /> </div> </div> <div> <label for="age">Age</label> <div> <input ng-required="true" ng-model="data.age" id="age" name="age" /> </div> </div> <div> <button ng-click="save(form)">Save</button> </div> </form> </div> </html>

actionController.html

 <html> <div ng-controller="actionController"> <div> <button ng-click="next()">Next</button> </div> </div> </html>

controlador.js

 app.controller('mainController', [{ $scope.action = function (action) { $modal.open({ templateUrl: 'actionController.html', controller: 'actionController' resolve: { params: function () { return {}; } } }) } }]); app.controller('formController', [{ $scope.save = function (form) {} }]); app.controller('actionController', [{ $scope.next = function () { // .... get data and check required data (form in formData.html) } }]);

en la siguiente función ¿Cómo puedo verificar el campo obligatorio del formulario si está en formData.html? Gracias.

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!