function verify(){
for (var i=1; i<5 ;i++){
var valor= "title"+i;
alert(valor);
var el=document.getElementById(valor);
var re=/^[a-zA-Z0-9 ]+$/;
if(!re.test(el.value))
{
alert("Remove special characters!");
document.getElementById(valor).value="";
}
}
}
I want verify the input not empty with this (with array):
function verificarMovies(){
var contador = 0;
for (var i=1; i<=30;i++){
if(document.getElementById("tituloep"+i).value!=""){
var count = new Array();
count [i] = "tituloep"+i;
contador++;
}
}
}
and after, verify if input with text respect this regular expression: /[1]+$/