I have added to my theme file valid.js Webform_tpl.php and in with :
drupal_add_js ( webform_client_form_4() . '/valid.js' );
o
drupal_add_js(drupal_get_path('theme', 'bartik') .'/valid.js');
In the image fields of webform.
http://desmond.imageshack.us/Himg37/scaled.php?server=37&filename=valida...
I would need to call the function validar_ccc when the form is submitted and remove the correct ccc alert .... but I get.
But the truth can not get it to work. I've been trying this validation until full and there is no way. Please help, thanks for your time.
Y el valid.js:
function obtenerDigito(valor){
valores = new Array(1, 2, 4, 8, 5, 10, 9, 7, 3, 6);
control = 0;
for (i=0; i<=9; i++)
{
control += parseInt(valor.charAt(i)) * valores[i];
}
control = 11 - (control % 11);
if (control == 11) control = 0;
else if (control == 10) control = 1;
return control;
}
function numerico(valor){
cad = valor.toString();
for (var i=0; i
var caracter = cad.charAt(i);
if (caracter<"0" || caracter>"9")
return false;
}
return true;
}
function validar_ccc (f)
{
if (f.banco.value == "" || f.sucursal.value == "" || f.dc.value == "" || f.cuenta.value == "")
{
alert("Por favor, introduzca los datos de su cuenta");
}
else
{