Form field validation
hi,
this not right post question if i'm in wrong place let me know.
i have form calculates area of play field.
the field must meet criteria, no length less 65ft on 1 side , not less than 8550 sq.ft).
//the applicant enters value length , width.
//the 2 fields validate number 65 or greater
//the form calculates total area.
var len = this.getfield("sitelength");
var width = get.getfield ("sitewidth");
var area = len * width;
// above works fine
// want alert when value below 8550
if(area=<8550){app.alert(“the total area below allowable standards”);}
// not working, think i'm close?
// want fields (length , width) reset 0 value when alert acknowledged.
i believe more if statements, like, sintax out lunch i'm indicating want.
if value area less 8550 setfield("sitelength")=0;
if value area less 8550 setfield("sitewidth")=0; .
that’s it, i’m green grass stuff , no spring chicken appricated.
tnx gypsyk9
the calculation script like:
// set names of input fields in array
var fn = ["sitelength", "sitewidth"];
// field values, strings
var len = getfield(fn[0]).valueasstring;
var width = getfield(fn[1]).valueasstring;
// calculate area if both fields have entries
if (len && width) {
var area = +len * +width;
// alert user if area less 8550
if (area < 8550) {
// show alert, blank field, , reset input fields
app.alert("the total area below allowable standards");
event.value = "";
resetform(fn);
} else {
// set field's value
event.value = area;
}
} else {
// blank field
event.value = "";
}
More discussions in PDF Forms
adobe
Comments
Post a Comment