Gird View Permission?

Gird View Permission?

Hello,

how can get this Code:

if(!(input.IATA_No.toString().matches("^\d{8}$")))
{
    alert "The IATA Number should be 8 digits long!";
    // replace 3 and 5 with min and max digits..
    cancel submit;
}

into the views?

Thanks Carsten