Here is what I am trying to do:
- Pick color
- Display value
- Display color in
div
- On
submit
, post AJAX to PHP
I feel like I am very close, just need that extra push as to where I am going wrong.
Here's a JSFiddle.
My current JavaScript:
app.controller('MyCtrl', function ($scope) {
$scope.targetColor = '#ec9040';
});
angular.bootstrap(document, ['app']);
jQuery(function () {
var field1 = $('#field1');
$('#send').click(
function () {
console.log('fieldvalue: field1.val()')
jQuery.ajax({
type: "POST",
url: "colormystatus.php",
data: {
field1value: field1.val()
},
dataType: "html",
success: function (data) {
alert(data);
}
});
});
});
}