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

114
Vistas
How I get form from html to javascript

How can I get the value of an HTML form to pass to JavaScript and check required field but form and modal check requried in different page HTML

mainpage.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>

controller.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)
    }
}]);

in function next How I can check form required field if from in formData.html Thank you.

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