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

169
Visualizações
Data entered in dynamic fields isnt saved in database

I have made a .NET MVC application where I need to send data from frontend to backend. I have created dynamic fields which get added when the user presses the button. But the input added in the dynamic fields is not saved to the database. My backend is on MVC .NET. I want to save the data entered in the dynamic fields.

Html Code:

<div class="form-group">
    <label class="col-md-4 control-label"> Phone Number :</label>
    <div class="col-md-8">
        <input type="text" class="form-control" id="inputLabel3" placeholder="PhnNumber" ng-model="UserContactVM.PhnNumber ">
    </div>
    <div ng-repeat="UserContactVM in inputs">
        <input type="text" ng-model="UserContactVM.v">
    </div>
    <button ng-click="add()">Add Input</button>
</div>

Javascript:

app.controller("UserController", function ($scope, $http) {
  $scope.btntext = "Save";
  $scope.inputs = [{ PhnNumber: "" }];
  ($scope.add = function () {
    var dataObj = { PhnNumber: "" };
    $scope.inputs.push(dataObj);
  }),
    ($scope.saveuser = function () {
      $scope.btntext = "Please Wait..";
      $http({
        method: "POST",
        url: "/User/Create",
        datatype: "json",
        data: JSON.stringify($scope.UserContactVM),
      }).then(
        function successCallback(response) {
          console.log();
        },
        function errorCallback(response) {}
      );
    });
});
about 4 years ago · Santiago Gelvez
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