-
1. Re: How restrict a field by Min-Max value
George_Johnson Aug 10, 2016 11:28 PM (in response to Shekharmine)and mall fields clear (text1.value="")
Can you clarify what you mean here? Do you want all of the 8 input fields to be cleared, or the calculated field to be cleared?
-
2. Re: How restrict a field by Min-Max value
Shekharmine Aug 11, 2016 12:32 AM (in response to George_Johnson)Thanks for reply.
all 8 text fields to be clear. means text length is equals to zero.
textbox.1value = " "
and also calculated field should be cleared.
hope you got it.
-
3. Re: How restrict a field by Min-Max value
George_Johnson Aug 11, 2016 1:06 AM (in response to Shekharmine)1 person found this helpfulThe custom calculation script could be something like:
// Custom calculation script for total fields
(function () {
var sum = 0;
// Array of input field names
aFields = ["text1", "text2","text3","text4","text5","text6","text7","text8"];
// Add up the values of the input fields
for (var i = 0; i < aFields.length; i += 1) {
sum += +getField(aFields[i]).value;
}
// Set this field value to the sum, unless it's greater than 60
if (sum <= 60) {
event.value = sum;
} else { // Clear all the fields and alert user
event.value = "";
resetForm(aFields);
app.alert("Error message goes here.", 3);
}
})();
Set the field names in the aFields array to match the names of the input fields and change the alert text.
-
4. Re: How restrict a field by Min-Max value
Test Screen Name Aug 11, 2016 1:24 AM (in response to Shekharmine)It's your form but I think clearing the fields will make this a difficult and annoying form for your users. Consider: the user knows the rule and wants to increase field 1, then decrease field 2. But as soon as they increase field 1, all fields are cleared and they must start again. Also users often do something like this: to decrease 45 to 42, first type 2 giving 425 then remove the 5 giving 42.
-
5. Re: How restrict a field by Min-Max value
JR_Boulay Aug 11, 2016 1:45 AM (in response to Shekharmine)Hi.
You don't need a script: select the Total field, go to Properties : Validation and enter a range of value from 0 (zero) to 60.
-
6. Re: How restrict a field by Min-Max value
Shekharmine Aug 11, 2016 9:17 PM (in response to JR_Boulay)Hey, you're great. it's working.
but
how to popup a custom error message? like
"Total should be 1 to 60"
-
7. Re: How restrict a field by Min-Max value
Shekharmine Aug 11, 2016 9:43 PM (in response to George_Johnson)thank you.
working. do you help in fixing some error popups always annoying.
tell me your email.
-
8. Re: How restrict a field by Min-Max value
George_Johnson Aug 11, 2016 11:11 PM (in response to Shekharmine)If you have a question about something, post it in the appropriate forum here.
-
9. Re: How restrict a field by Min-Max value
Shekharmine Aug 12, 2016 9:09 PM (in response to George_Johnson)Hi, i cannot explain, but i have recorded my desktop and the link is here for the video.
please watch it..
accrobat [send me form back: shekharmine at gmail dot com] - YouTube
Here is my PDF download and modify the script and send me back. thank you..
LRC supervision log for BACB - for editing.pdf - Google Drive
each and every time i am entering to a new cell, it's showing error.
please remove that error.
here is Help Article similar to this:
The value entered does not match the format of the field
thank you.
-
10. Re: How restrict a field by Min-Max value
George_Johnson Aug 12, 2016 9:51 PM (in response to Shekharmine)Most of the trouble is caused by the calculated fields that include a numeric division operation where the denominator is zero. Whenever you do a division by a field value, you have to use JavaScript to check if the value of the denominator is zero. When you divide by zero, the result can't be formatted as a finite number, so you see the errors you're getting. This is a common problem, so you should be able to find more help with a search, but post again if you get stuck.
-
11. Re: How restrict a field by Min-Max value
JR_Boulay Aug 16, 2016 2:17 AM (in response to Shekharmine)how to popup a custom error message? like "Total should be 1 to 60"
You need to use JavaScript, you cannot customize a built-in Acrobat message.