Start an action when a Text field has a value
I have been reviewing over so many options and ideas that have solved several answers... but I cannot for the life of me, find what it is I am trying to do. I have been back and forth with several options, but just cannot get it to work.
Scenario:
This is a form for customers to fill out when they may be online and have interest. Instead of calling in, they can fill out this quick form and get an idea what the cost may be.
One line option is similar to this one.
How many oranges would you like to have? ______
Users are to just type a number into a textfield placed where the underline is. If they type "4", then it should start an action and fill out the "demo" invoice. This textfield would be called, "txtNumOrng". Format would be a number.
Once this number is typed in, down within the same adobe pdf, we have a "demo" invoice with columns showing "Description", "Qty", "UnitPrice" and "TotalPrice" that should be filled in. In this scenario:
Description would be oranges, "Qty" would equal the text placed within the textfield "txtNumOrng", etc. etc. If this txtNumOrng field is emptied, then the entire line within the "demo" invoice would be cleared.
This is what I have been tinkering with to get this to maybe work the right way:
---------------------------------------------------------
var txtToDesc = "ORANGES";
var txtToDesc2 = "ORANGES: Cleaned with more description if needed for this line";
var txtOrngUnitPrice = "100";
var cbOranges = this.getField("cbOranges");
var txtNumOrng = this.getField("txtNumOrng");
if (checkbox.value == "100") {
textbox.readonly = false;
}
else
{
textbox.readonly = true;
textbox.value = "";
}
this.getField("3rdLineDescA").value = (event.target.value == "Off")? "" : txtToDesc2;
this.getField("3rdLineQtyA").value = (event.target.value == "Off")? "" : txtNumOrng;
this.getField("3rdLineUPA").value = (event.target.value == "Off")? "" : txtOrngUnitPrice;
----------------------------------------------
Checkbox? Yes, I have even tried to pass the text field to start a checkbox action and try to have the checkbox to complete the invoice entry. Close, but not the right way IMHO. The checkbox is not necessary, but more of a "I have an idea" idea. Ya'll been there too, don't deny it.
Any thoughts on this or other ideas? You probably need more information so ask away. Typing it all out here may be more confusing without the questions you need answered. Thanks ahead of time!
