Question number one: Is it possible thing to make an angularJS form into an ajax json variable request? note: I'm using it because of it's pattern, just for validation rule of form. It's very simple and taft, i like it.
Question number two: If this way doesn't worked, is there any other security way as simplest as like this angularJS system which can be done inside an ajax like this?
this is my simple ajax code:
var x;
function clickreply(obj){
var varid = obj.id;
var getnumb = varid.match(/\d/g); //get number from string
var idreply = 'idreply'+getnumb;
console.log(varid);
console.log(getnumb);
console.log(idreply);
$.ajax({
url: '/logincheckmember2.php', //This is the current doc
type: "POST",
dataType:'json', // add json datatype to get json
success :
function (result) {
x=result['ssloginmember'];
console.log(x);
if(result['ssloginmember']==null){
msgBLshow();
}else{
x="<center>"+
"<form method='post' ng-controller='formctrl' name='myForm'>"+
"<textarea id='tareply' rows='4' cols='50' maxlength='250' placeholder='maxlength=250' ng-model='tareply' required ng-pattern='/^[A-Za-z0-9/\.\-\s\,]*$/'></textarea><br>"+
"<span ng-show='myForm.tareply.$error.pattern' ng-cloak><img src='/img/xred.png'></img> <font color='red'>invalid value</font></span><br>"+
"<input type='button' value='reply' onclick='clicktareply()' ></input>"+
"</<form>"+
"</center>";
document.getElementById("msgcontent1").innerHTML=x;
$("#msg1").fadeTo(1000, 1);
}
}
});
}
function clicktareply(){
alert(document.getElementById("tareply").value);
}