-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathini_script.js
36 lines (31 loc) · 1.17 KB
/
ini_script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var UNAME = document.cookie;
function submitIni() {
var xhttp = new XMLHttpRequest();
var goal;
var tipo = document.getElementById("scope").value;
if(tipo=='1'){
goal = Number(tipo)*250;
}
else if(tipo=='2'){
goal = Number(tipo)*250;
}
else if(tipo=='3'){
goal = Number(tipo)*250;
}
var params ='titulo='+document.getElementById("titulo").value+'&problema='+document.getElementById("problema").value+'&tipo='+document.getElementById("scope").value+"&usuario="+UNAME+"&descripcion="+document.getElementById("description").value+"&goal="+goal;
xhttp.open("POST", "register_ini.php", true);
xhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhttp.send(params);
xhttp.onreadystatechange =function(){
if(this.readyState==4 && this.status==200){
if(xhttp.responseText=='Registrado Exitosamente'){
alert("Registrado Exitosamente");
}
else{
alert(xhttp.responseText);
}
return false;
}
}
return false;
}