Can't send character variable to Javascript function

Hi. I have a Form :

In ApplicationInit :
[glo_patron] = “a”;

I have a Javascript Button that says:
var caal = [wcaal];
var usuario = [glo_usuario];
var patron = [glo_patron];
enable(caal,patron,usuario);

And then I have a Javascript functiion called “enable” with this:
for (x = 1; x <= caal; x++){
var cdia = ‘id_sc_field_dia_’+x;
document.F1[cdia].disabled = false;
document.F1[cdia].value = patron;
}

The problem I have is that if [glo_patron] is a number, it works ok. But if it is a character, the app hangs.

What am I doing wrong? Anybody can help me? Thankyou
Prof. Sergio Rassino