
function setpt_cApplication_Lib_CForm()
{
cApplication.prototype.GetStrFormField = cApplication_GetStrFormField;
cApplication.prototype.GetNumFormField = cApplication_GetNumFormField;
cApplication.prototype.GetDTFormField = cApplication_GetDTFormField;
cApplication.prototype.GetBitFormField = cApplication_GetBitFormField;
cApplication.prototype.GetRadioFormField = cApplication_GetRadioFormField;
cApplication.prototype.GetSelFormField = cApplication_GetSelFormField;
cApplication.prototype.ValidateStrFormField = cApplication_ValidateStrFormField;
cApplication.prototype.ValidateNumFormField = cApplication_ValidateNumFormField;
cApplication.prototype.ValidateDTFormField = cApplication_ValidateDTFormField;
}
function cApplication_GetStrFormField(
ofld,
empty2null
)
{
var rv;
if (empty2null == null)
empty2null = true;
rv = ofld.value;
if (!rv.length && empty2null)
rv = null;
return(rv);
}
function cApplication_GetNumFormField(
ofld,
isint
)
{
var rv;
if (isint == null)
isint = false;
rv = ofld.value;
if (rv.length) {
rv = this.ParseNum(rv);
if (isNaN(rv))
rv = null;
else {
if (isint)
rv = parseInt(rv);
}
}
else
rv = null;
return(rv);
}
function cApplication_GetDTFormField(
ofld
)
{
var rv = ofld.value;
if (rv.length)
rv = this.ParseDT(rv);
else
rv = null;
return(rv);
}
function cApplication_GetBitFormField(
ofld
)
{
return( ofld.checked ? 1 : 0);
}
function cApplication_GetRadioFormField(
ofld
)
{
var retval, l, i;
retval == null;
l = ofld.length;
if (l+"" == "undefined") {
if (ofld.checked)
retval = ofld.value;
}
else {
for (i = 0; (i < l) && (retval == null); i++)
if (ofld(i).checked)
retval = ofld(i).value;
}
return( retval );
}
function cApplication_GetSelFormField(
ofld
)
{
return( ofld.options[ofld.selectedIndex].value );
}
function cApplication_ValidateStrFormField(
ofld,
mayempty,
minlength,
maxlength,
fldname
)
{
var str;
str = this.RTrim(ofld.value);
ofld.value = str;
if (!str.length)
str = null;
return( this.ValidateText(str, mayempty, minlength, maxlength, fldname) );
}
function cApplication_ValidateNumFormField(
ofld,
mayempty,
lobound,
hibound,
fldname,
isint
)
{
var n;
n = this.RTrim(ofld.value);
ofld.value = n;
if (!n.length)
n = null;
else
n = this.ParseNum(n);
return( this.ValidateNum(n, mayempty, lobound, hibound, fldname, isint) );
}
function cApplication_ValidateDTFormField(
ofld,
mayempty,
fldname
)
{
var dt;
dt = this.RTrim(ofld.value);
ofld.value = dt;
if (!dt.length)
dt = null;
else
dt = this.ParseDT(dt);
return( this.ValidateDateTime(dt, mayempty, fldname) );
}
setpt_cApplication_Lib_CForm();
