My code so far:
<p><script language="javascript">
function funcion(){
var a ="field_1";
var b ="field_2";
var c ="field_3";
var d ="field_4";
var e ="field_5";
var f ="field_6";
var g ="field_7";
var aa = document.getElementById(a).value;
var bb = document.getElementById(b).value;
var cc = document.getElementById(c).value;
var dd = document.getElementById(d).value;
var ee = document.getElementById(e).value;
var ff = document.getElementById(f).value;
var gg = document.getElementById(g).value;
$.post("Aqui va mi URL", { dni: aa, proc: bb, firma: cc, exp: dd, us: ee, "11": ff, "10": gg }, <br>function(data){
$("#principal").html(data);
});
}
window.onload = funcion;
So far the JavaScript and the HTML are simple. There are 7 normal and ordinary fields.
What I'm trying to do is that when you send the data to a page, it sends it back again. That is, page 1 sends data to page 2, and page 2 enters a database and automatically sends them to page 3
I get the following error.
Uncaught TypeError: Can not read property 'post' of undefined at work at window.onload
Does anyone have any idea why?
That same code I used before, just modify one or two things. Although I do not know what this is "$("#principal").html(data);"
. I put the form of that ID name just in case, maybe it's wrong.
Thanks for the inconvenience.