Refresh an AI field

By: David Calderon | Asked: 06/25/2025
ForumsCategory: Code HelpRefresh an AI field
David Calderon asked 2 weeks ago

How can I set it up so that a button will regenerate the response provided in an ai field. So lets say I enter some information and I ask it to write a story. Then after it generates the story, I can modify the info I provided and hit a regenerate button to get an updated response in the ai results field without it refreshing everything and losing the original information I entered. Any help you can provide would be greatly appreciated!

1 Answers
Bobby Clapp Staff answered 2 weeks ago

Do you mean like this: https://formidableforms.com/knowledgebase/form-ai/#kb-ai-questionIf I'm reading it right, it looks like the "Question" field takes a shortcodes representing a text input field that will update the question automatically when you change the context.

David Calderon replied 2 weeks ago

Yes, thank you but it only works if you click out of it once you finish updating it. Often times they don't read instructions so I thought....have them click a button. Then maybe show a little thinking animation. while its regenerating the response but I can't get it to work.....sooo

I made a button using some javascript that says "Generate Story" then it shows "Generating Story" with a little thinking animation. After 6 seconds, it stops and says "Regenerate Story". All it really does is that. This isn't tied to anything other than the button doing this process after you click on it. But it achieves the objective of getting the user to click out of the AI question prompt so it will regenerate based on what you updated.

However, if they just want to get a different version of the story based on the original prompt, it doesn't work because the original prompt did not actually get changed...or maybe they didn't even click on it to try and change it.

So I thought maybe there is a way to have the button actually start a refresh on the ai response without having to reenter the original prompt entry from the user. I hope that makes sense?

Bobby Clapp Staff replied 2 weeks ago

Sure. What if you check the "hide response" field?

"If you do not want to see the AI response immediately in the form, select the Hide Response checkbox in the AI field options. By default, this option is unchecked."

That would force the user to interact.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right