Forum Academy Marketplace Showcase Pricing Features

Issue with filling input using Javascript

Hey everyone!
So I have this setup in my website
image (1)
The initial value of the input is set to the value of custom state which is 10. When the button 20 is clicked, custom state value will be set to 20 and input value will be changed to 20 and so on. The issue is, when user changes the input value once, I can’t fill up input value with custom state’s value. So I’m using Javascript to do this. The JS code I’m using is this
$("#InputID").val(Customstatevalue). Now this is working, and filling the input value even though it is changed by the user. But the issue is that this value is not getting detected by Bubble. The input box still looks red which means it’s empty even though I clicked on a number button and value is setup to input using Javascript. Please help!

1 Like

Help…

1 Like

I figured this out.
When a numbered button is pressed, I’m setting custom state value to that number and resetting the data of the group that is holding the input element using “Reset data”.
That did the trick!

1 Like

Hello maheshkasindi!

I have the same issue - I populate input fields through running JS and assigning value using ID. Bubble deems input to be empty, though optically there is value in it. Thus it can’t save anything to the DB. Resetting data for the group-container doesnt help, unlike in your case. Maybe you know other workarounds?:slight_smile:

Thank you!)

1 Like

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