Last updated: 2022-07-27
Source: https://support.freshdesk.com/support/solutions/articles/154064-pre-populating-feedback-widget-form
Pre-populating feedback widget form
``` Note: If you can't see the Feedback Widget in your admin settings, you can make use of Widgets and the Feedback form. The Feedback widget is being phased out in batches due to the availability of the better and more functional help widget. Please contact support@freshdesk.com if you need any help with setting up the help widget. ```
The Feedback Widget can be easily installed on your website, your portal, or just about any web page you want. It lets your customers create support tickets easily, and makes your support more accessible to them.
You can pre-populate the meta information in your Freshdesk Feedback Widget when your customers try to get in touch with you. Whenever they use the widget, you could have their names, email addresses, or any common relevant information pre-populated into the ticket form based on existing data. That way, they will be able to get the ticket created quickly.
You can also set default values for ticket fields, such as dropdowns, nested fields, checkboxes, etc.

Passing ticket form elements into the feedback widget
Passing default fields
| Ticket field | How to use this | Ruby on rails example |
| Requester email (the email address of logged in users) | helpdesk\_ticket\[requester\]={{user.email}} | helpdesk\_ticket\[requester\]=<% logged\_in\_user.email %> |
| Ticket subject | helpdesk\_ticket\[subject\]={{ticket.subject}} | helpdesk\_ticket\[subject\]=Order tracking |
Passing custom fields
- Hint: Right-click on the field and hit 'inspect element' in Chrome, or use the firebug in Firefox.

A quick guide on pre-populating ticket fields:

For the Pop-up widget:
```javascript
```
JavaScript
``` Note: The pop-up widget is being phased out in batches due to the availability of help widget, which is better and more functional. You can learn how to prepopulate fields in the help widget here. ```
For the Embedded widget:
```javascript
```
JavaScript
Disabling pre-populated fields
You can disable the fields you pre-populate in the feedback widget so that their values cannot be changed by your ticket requesters. For example, you may have a custom field called location in your ticket form which you don't want your customers to edit. In that case, you can disable the location field by tweaking the widget code. You just need to add '&disable\[fieldName\]=true' or '&disable\[custom\_field\]\[fieldName\]=true' depending on whether the field is default or custom.
In this code, the fields 'requester' and 'product\_id' are disabled.
```javascript
```
JavaScript
Paste this code on all the pages of your website and application that you want the popup feedback widget to appear on.
Sample screenshot of how the field would show up on your widget upon disabling pre-populated fields:

Further instructions for web applications:
If you are looking to use the Freshdesk feedback widget in applications based on frameworks like React, Angular or Ember, you need to include a line along with the widget's code to the population is working properly. This will make the widget initialize immediately instead of waiting for a window.load which would have already happened in the case of a web application.
```html
```
HTML
The Feedback Widget can be easily installed on your website, your portal, or just about any web page you want. It lets your customers create support tickets easily, and makes your support more accessible to them.
You can pre-populate the meta information in your Freshdesk Feedback Widget when your customers try to get in touch with you. Whenever they use the widget, you could have their names, email addresses, or any common relevant information pre-populated into the ticket form based on existing data. That way, they will be able to get the ticket created quickly.
You can also set default values for ticket fields, such as dropdowns, nested fields, checkboxes, etc.

Passing ticket form elements into the feedback widget
Passing default fields
| Ticket field | How to use this | Ruby on rails example |
| Requester email (the email address of logged in users) | helpdesk\_ticket\[requester\]={{user.email}} | helpdesk\_ticket\[requester\]=<% logged\_in\_user.email %> |
| Ticket subject | helpdesk\_ticket\[subject\]={{ticket.subject}} | helpdesk\_ticket\[subject\]=Order tracking |
Passing custom fields
- Hint: Right-click on the field and hit “inspect element” in Chrome, or use the firebug in Firefox.
A quick guide on pre-populating ticket fields:

For the Pop-up widget:
```javascript
```
JavaScript
For the Embedded widget:
```javascript
```
JavaScript
Disabling pre-populated fields
You can disable the fields you pre-populate in the feedback widget so that their values cannot be changed by your ticket requesters. For example, you may have a custom field called location in your ticket form which you don't want your customers to edit. In that case, you can disable the location field by tweaking the widget code. You just need to add '&disable\[fieldName\]=true' or '&disable\[custom\_field\]\[fieldName\]=true' depending on whether the field is default or custom.
In this code, the fields 'requester' and 'product\_id' are disabled.
```javascript
```
JavaScript
Paste this code on all the pages of your website and application that you want the popup feedback widget to appear on.
Sample screenshot of how the field would show up on your widget upon disabling pre-populated fields:

Further instructions for web applications:
If you are looking to use the Freshdesk feedback widget in applications based on frameworks like React, Angular or Ember, you need to include a line along with the widget's code to the population is working properly. This will make the widget initialize immediately instead of waiting for a window.load which would have already happened in the case of a web application.
```js
```
JavaScript