Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

115
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda