So, I get why traditional form submission isn't really supported or recommended. But I have a situtation where I need to build a form and submit it to paypal, and I'm really struggling to make it work. I have something like this now:
<form action="
https://www.paypal.com/cgi-bin/webscr" method="post" id="giftform">
<input type="hidden" name="item_name" value="$25 gift certificate" ng-model="model.item_name">
<input type="hidden" name="amount" value="25.00" ng-model="model.amount">
<button class="btn btn-success" style="font-size: 20px;" ng-click="gimme();">Gimme!</button>
and a controller with this:
$scope.gimme = function() {
console.log(document.giftform);
document.giftform.item_name = $scope.model.selectedItem.textvalue;
document.giftform.amount = $scope.model.selectedItem.denomination;
// document.giftform.submit();
}
And I'm getting :
Error: document.giftform is undefined
Surely this isn't so complicated, and I'm just missing something simple?