When we have a customer fill out our credit application, I would like a sales tax exemption form filled out for certain States. This is dictated by the customers home State and if we have a presence in that State. For all other States we do not need this form filled out. In other words if the State equals A, B, C or D then the form is required. If the State is E, F, G..... the form is not required and continue on to references. I'm a newbie and have both forms with their respective fields setup and have added a submit button to the credit reference form with an email address but can't figure this one out. I also don't know Java Script. Any help is greatly appreciated.
Thanks.
Sorry, yes. I will have a drop down box that lists all 50 states. Of the 50 states we only require a sales tax exemption form to be filled out for 6 states. When the applicant selects one of the 6 states the tax exemption form would come up as a required form. All other states the form is not required.
You can use the validate event of the dropdown to check the current
selected value and then set the required property of the fields in
question. So, for example, if the tax exemption fields is called "Tax
Exemption" and you want to make it required if "Alaska" or "Ohio" are
selected, you can use something like this:
this.getField("Tax Exemption").required = (event.value == "Alaska" ||
event.value == "Ohio");
Thank you that worked great. Now, can I associate another form with the "Tax Exemption" field? In other words, if you live in AK you have to fill in the tax exemption field with your state number (which the above acomplishes) and fill out a certificate of resale and equipment exemption form.
Sorry crazy day here, thank you for bearing with me..If we have a presence in AK the user then will fill in the required tax number in the tax exemption field and another form will come up that will be required to be filled in. This form is a certificate of resale and equipment exemption form. Once this form is completed both forms will be emailed back to an employee's email address via a submit form button. We do not require the certificate of resale and equipment exemption form to be filled out if we have no presence in that state.
This is not so easy to implement. You say that the other form will "come
up". That means that the script needs to know where that form is located.
So that means the documents always have to be in the same location on each
computer, or always be in the same relative location to one another.
Another option is to set all the files in a portfolio, which might make it
simpler.
I would consider another approach, like presenting the user with a message
saying they have to fill in the other file, or merging the two documents to
a single PDF, and enabling/disabling the form fields of the exemption form
based on the state selection.
Ok, I have merged the forms to a single pdf. I have the state field on the credit application with the following validation this.getField("Sales Tax ID#").required = (event.value == "AR" || event.value == "CA" || event.value == "IL" || event.value == "MI" || event.value == "PA"); Does a validation script need to be created to enable/disable the form fields in the exemption form based on selecting AR, CA, IL, MI or PA?
Yes, it will be very similar to that one. Although, I would suggest splitting the two parts of the code. Let's say you want to make the fields "Text1" and "Text2" visible if any of those states are chosen, or invisible otherwise.
You can use something like this:
var isTaxExemption = (event.value == "AR" || event.value == "CA" || event.value == "IL" || event.value == "MI" || event.value == "PA");
if (isTaxExemption==true) {
this.getField("Text1").display = display.visible;
this.getField("Text2").display = display.visible;
} else {
this.getField("Text1").display = display.hidden;
this.getField("Text1").value = "";
this.getField("Text2").display = display.hidden;
this.getField("Text2").value = "";
}
North America
Europe, Middle East and Africa
Asia Pacific