Hello, could anyone help me with a code for a button when clicked, incremements by 1. I have a numeric field (not sure if it should be a numeric or text field), and a button. I want when the user clicks the button, the number in either the text or numeric field increments by 1. I also need a code for another button, that when clicked, clears the text field. I appreciate your help.
Solved! Go to Solution.
Views
Replies
Total Likes
To increment....
// form1.page1.subform1.incBtn::click - (JavaScript, client)
form1.page1.subform1.nf.rawValue = form1.page1.subform1.nf.rawValue + 1;
if (form1.page1.subform1.tf.isNull) {
form1.page1.subform1.tf.rawValue = "0";
}
var numStr = form1.page1.subform1.tf.rawValue;
form1.page1.subform1.tf.rawValue = parseInt(numStr) + 1;
Views
Replies
Total Likes
To increment....
// form1.page1.subform1.incBtn::click - (JavaScript, client)
form1.page1.subform1.nf.rawValue = form1.page1.subform1.nf.rawValue + 1;
if (form1.page1.subform1.tf.isNull) {
form1.page1.subform1.tf.rawValue = "0";
}
var numStr = form1.page1.subform1.tf.rawValue;
form1.page1.subform1.tf.rawValue = parseInt(numStr) + 1;
Views
Replies
Total Likes
Wow, that works awesome. Thanks for such a rapid response.
Views
Replies
Total Likes
Thanks for the response, can a "clear" button be used to clear all the fields to include a calendar and dropdown list? basically push one button and all the fields become blank. I guess I could add each field in the .rawValue=null, but there are too many to do that. I tried using xfa.event.reset() but that did not work
Views
Replies
Total Likes
Thanks for the response, can a "clear" button be used to clear all the
fields to include a calendar and dropdown list? basically push one button
and all the fields become blank. I guess I could add each field in the
.rawValue=null, but there are too many to do that. I tried using
xfa.event.reset() but that did not work
Views
Replies
Total Likes
There is an object in the standard library called 'Reset Button'. It clears all form fields by issuing xfa.host.resetData().
Steve
Steve you always come through, thanks for always being so helpful.
Views
Replies
Total Likes