vuelvo a poner el codigo con el resaltador de codigo
Código asp:
Ver original<%
Function AbrirConexion()
Dim Conexion
adOpenKeyset = 1
adLockOptimistic = 3
Set Conexion = Server.CreateObject("ADODB.Connection")
Conexion.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=lachc$InetpubwwwrootQuinielaDBTragaMonedas. mdb"
Set AbrirConexion = Conexion
End Function
Function DevolverRecordset(strSQL)
Dim Rs
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open strSQL, cn, 3, 1
Set DevolverRecordset = Rs
End Function
Sub ExecutarConsulta(strSQL)
Dim Rs
dim cn
Set Rs = Server.CreateObject("ADODB.Recordset")
set cn = AbrirConexion
Rs.Open strSQL, cn, 3, 1
End Sub
%>
<script>
function checkValores()
{
var rta;
rta = true;
if (!IsNumeric(document.getElementById("serie").value )){
alert("los valores a ingresar deben ser numericos");
rta = false;
}
return rta;
}
function IsNumeric(sText)
{
var ValidChars = "0123456789.";
var IsNumber=true;
var Char;
for (i = 0; i < sText.length && IsNumber == true; i++)
{
Char = sText.charAt(i);
if (ValidChars.indexOf(Char) == -1)
{
IsNumber = false;
}
}
return IsNumber;
}
function guardarConfiguracion()
{
if (checkValores())
{
//guardo los valores en la tabla
var sql;
sql = "INSERT INTO CONFIGURACIONES (Serie, Ganadores, Bonus)";
sql += "VALUES(";
sql += document.getElementById("serie").value + ", ";
sql += document.getElementById("ganadores").value + ", ";
sql += document.getElementById("bonus").value + ")";
ExecutarConsulta(sql)
}
}
function cargarConfiguracion()
{
document.getElementById("serie").value = "15";
document.getElementById("ganadores").value = "8";
document.getElementById("bonus").value = "5";
}
</script>