i have serious difficulties with sending variables to my backend(classic asp)
. I can't get the elements right.
However, if I get it from a normal HTML FORM
I can catch and edit the variables.
Why can't I do that with my AJAX?
My Ajax
node.forEach((element)=>{ arr.push(element.value); i++;});
let xhr = new XMLHttpRequest;
xhr.open('post', '../Update/updateAusgabearten.asp', true);
xhr.setRequestHeader('Content-Type', 'application/json');
let test = {" arr[0], arr[1], "Prozent="+arr[2]}
xhr.send("ID="+arr[0] + '&' + "Name="+arr[1] + '&' + "Prozent="+arr[2]);
My Backend(Classic Asp)
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "DRIVER={SQLite3 ODBC Driver};Database=C:/inetpub/wwwroot/TestDatabase/saver.sqlight3"
SET rs=Server.CreateObject("ADODB.recordset")
dim sql
sql = "UPDATE Ausgabenarten " &_
"SET Name=" & CStr(request("Name")) & "" &_
", prozente=" & CDbl(request("Prozent")) & "" &_
"WHERE id=" & CInt(request("ID")) & ""
conn.Execute sql
conn.close
End if
I would be very happy if someone would show me how to do this with an example he tested himself.
I would also like to send an array with ajax and receive it from my backend(Classic asp).