Awesome Support has one primary form that users can use to submit tickets. To create multiple forms (including multi-page and conditional forms) you can use the Gravity Forms plugin along with our Gravity Forms bridge.
However, in many cases you can simulate multiple forms by pre-populating the form fields with data passed in via URL QUERYVARs.
Ok, yes, that sounds complicated. But it is rather easy as long as you know the names of the fields on the form. Here are some examples – and then we’ll show you how to use QUERYVARs to simulate multiple forms.
Lets say that you want to populate the SUBJECT FIELD with the value “PRODUCT INQUIRY”. Under normal circumstances the url to the submit ticket page on the front end would be something like this:
HTTPS://www.yourdomain.com/submit-ticket
.
However, if you modify that URL to this:
HTTPS://www.yourdomain.com/submit-ticket/?wpas_title=PRODUCT INQUIRY
Your form page will render with the subject field already populated with the value PRODUCT INQUIRY.
Lets say that you want to populate the DEPARTMENT FIELD with one of the departments in your department list. Since the department field is a WordPress TAXONOMY (drop-down list), the first thing you would need to do is to find out the WordPress ID for that value by looking for it in your department list (TICKETS->DEPARTMENTS). Lets say that ID is 36.
The URL of your ticket page can be set to:
HTTPS://www.yourdomain.com/submit-ticket/?wpas_department=36
which will pre-populate the department with whatever the value 36 corresponds to.
Lets say that you have created a custom field called MODEL and you want to pre-populate it with the value TOYOTA. The URL of your ticket page can be set to:
HTTPS://www.yourdomain.com/submit-ticket/?wpas_model=TOYOTA
Now that you know how you can pre-populate forms with values, you can create multiple menu items in WordPress, each with a different URL as outlined above. Each URL in your menu will lead to a form that is pre-populated with different values. For many users, that’s all that is needed. But you can get a little more creative with some CSS as we’ll see in the section below.
OK, so what if you wanted to get more creative such as hiding the field you’re pre-populating. For example, If you want to have one form where the Department field is shown and another one where it’s not shown but pre-populated and submitted with the ticket.
To do this:
HTTPS://www.yourdomain.com/submit-ticket
– this would be the regular submit ticket page with all fields visible.
HTTPS://www.yourdomain.com/submit-ticket-2/?wpas_department=36
– this would be the page with the department pre-populated where we want to hide the department field.
To hide the department field on this page you would have to use some CSS in your theme that is very specific to that page. That CSS would look like this:
.page-id-7 #wpas_department_wrapper { display: none }
Notice that the first CSS selector we use is “.page-id-7”. In our example, “7” would be the WordPress page id of the second page with the submit-ticket shortcode on it.
By using this CSS selector we make sure that the only page affected by this CSS is the second page and not the first one. The end result is that the department field is hidden in the second page (but gets the default value of 36) while still being shown in the first page.
You can use this idea to create custom pages for each of your department.
For example If you have five departments and each of them have different custom fields that need to be shown, you can create 5 pages with different queryvars that pre-populates the department field and uses CSS to hide it as well as hide any other custom fields that might not be needed on the page for that department.
You can pre-populate multiple fields using the same technique – just separate each value pair with an “&” sign. For example – you can do this:
HTTPS://www.yourdomain.com/submit-ticket/?wpas_title=PRODUCT INQUIRY&wpas_model=TOYOTA&wpas_department=36
See Also