JSCRIPT 3
After a long time, I will work again on this site, and I will give you more Samples and News. The next Days there will be a few Samples of Jscript Codes, after that I will give you some News about CRM 4.0, so I am back again.
So this is a little Script, which checks the Values in a particular Field, so you can get sure, that only useful Values will be entered. I took the Salutation Field, to check the entered Values.
There is something more new, in the past, there were a lot of Problems with code-samples on this Page, so i decide to put the Code in a Text-File where you can download it with no errors.
JAVASCRIPT
-
//At first, we create an Array, that will be filled with your parameters we want to check
-
var array1=new Array(2);
-
array1[0]="Mr";
-
array1[1]="Mrs";
-
array1[2]="Mr and Mrs";
-
-
var check1=crmForm.all.salutation.value;
-
var x = 0;
-
var y = 0;
-
-
//That’s the For-Loop, which will check our field with our parameters, if there is anything wrong, alert will come up.
-
for (x=0; x<3; x++)
-
{
-
if (check1 == array1[x])
-
{
-
ende1();
-
break;
-
}
-
else
-
{
-
y=y+1
-
}
-
}
-
-
if (y > 2)
-
{
-
alert("The Field SALUTATION is filled wrong \n That’s the write Values: \n Mr, Mrs, Mr and Mrs");
-
event.returnValue = false;
-
return false;
-
}
-
-
function ende1()
-
{
-
}
Link for Download: DOWNLOAD

