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

117
Views
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
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!