# How to fill a input on click

**URL:** <https://forum.bubble.io/t/how-to-fill-a-input-on-click/162756>\
**Category:** Need help\
**Created:** [August 2, 2021, 2:25pm UTC](https://forum.bubble.io/t/how-to-fill-a-input-on-click/162756 "2021-08-02T14:25:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![siddharth](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/siddharth/32/99706_2.png) [@siddharth](https://forum.bubble.io/u/siddharth)\
**Post date:** [August 2, 2021, 2:25pm UTC](https://forum.bubble.io/t/how-to-fill-a-input-on-click/162756/1 "2021-08-02T14:25:37Z")

</div>

I have a search box of geographic location. I want that when a icon is clicked it gets populated with current geographic address.

I don’t want to use current geographic location in default value or placeholder.

Thanks

---

<div class="post-metadata">

**Author:** ![anthony.schanen](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/anthony.schanen/32/92011_2.png) [@anthony.schanen](https://forum.bubble.io/u/anthony.schanen)\
**Post date:** [August 2, 2021, 4:49pm UTC](https://forum.bubble.io/t/how-to-fill-a-input-on-click/162756/2 "2021-08-02T16:49:52Z")

</div>

Use a state, lets call it “location”

Create a state for the search box (click the little “i” icon at the top when editing the searchbox) and set the value of that state to blank. Then default value of the box to state “locations” value

Then create a workflow “when this icon is clicked” —\> “set state of element searchbox” then select location and fill in the current users location

hope that helped

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [October 11, 2021, 2:26pm UTC](https://forum.bubble.io/t/how-to-fill-a-input-on-click/162756/3 "2021-10-11T14:26:15Z")

</div>

This topic was automatically closed after 70 days. New replies are no longer allowed.
