# Add Logged in User's IP Address to Form

> Please note that this is now available as a plugin for easier installation. While you can use this document as a reference, the recommended method to add…

Source: https://tadabase.com/docs/snippets/add-logged-in-users-ip-address-to-form  
Status: Not yet re-checked. Moved from our previous help site and not yet re-checked against the current product. Last edited Sep 20, 2024.

> **Warning:** Please note that this is now available as a plugin for easier installation. While you can use this document as a reference, the recommended method to add this functionality is through the plugin installation wizard. Learn more about plugins [here](https://tadabase.com/docs).

**To set up a form to Auto-fill an IP address, you can follow the following steps below.**

![Screenshot for “Add Logged in User's IP Address to Form”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-08/scaled-1680-/2022-08-23_15-37-46.png)

**1. Add a Text field called "IP" to the Data table connected to the Form Component.**

![Screenshot for “Add Logged in User's IP Address to Form”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-08/scaled-1680-/2022-08-23_15-41-45.png)

**2. Get the Field ID of this text field. To do This, go to the Fields tab, click the settings, and copy the Field ID.**

![Screenshot for “Add Logged in User's IP Address to Form”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-08/scaled-1680-/2022-08-23_15-44-58.png)

**3. Navigate to the page containing the form. Within the page, find the Component ID.**

![Screenshot for “Add Logged in User's IP Address to Form”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-08/scaled-1680-/2022-08-23_15-50-22.png)

**4. Within the following code, edit the ID following "field" to the field ID from your table and the Component ID from your page.**

```
var ipInputID = 'fieldkOGQ3gQlnA';
TB.render('component_39', function(data) {
    $.get("https://api.ipify.org", function(data) {
        $('#' + ipInputID)
            .val(data)
            .change();
    });
});
```

![Screenshot for “Add Logged in User's IP Address to Form”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-08/scaled-1680-/2022-08-23_16-00-44.png)

**5. Add this code to the JavaScript tab of the page for a form component that will auto-fill the user's IP!**
