How to create hidden filed programmatically ?

By: Neosoft Neosoft | Asked: 05/11/2023
ForumsCategory: Code HelpHow to create hidden filed programmatically ?
Neosoft Neosoft asked 12 months ago
I want to create hidden field on front-end programmatically , when user visit page and found formidable forms in the page.   How do I do this ? Is there any hook available that I can use ?
Attachments
Question Tags:
2 Answers
Rob LeVineRob LeVine answered 12 months ago
To create a field programmatically you can issue a SQL insert command on the frm_fields table, however, I'm curious why you want to create a field on the fly, rather than just having a hidden field on the form and putting a value it via a hook. Also what does "found formidable forms in the page" mean? Are you saying they're just navigating to the page or that they've submitted a form?
Neosoft Neosoft replied 12 months ago

I am using multiple forms like WPForms , GravityForms and Formidable Form
In some of the post I have WPForms , some have GravityForms and some have Formidable form while some post have only content , no forms

So I want to create dynamic hidden field which have Formidable Form.

Neosoft Neosoft answered 12 months ago
I am using multiple forms like WPForms , GravityForms and Formidable Form
In some of the post I have WPForms , some have GravityForms and some have Formidable form while some post have only content , no forms So I want to create dynamic hidden field which have Formidable Form.
Attachments
Rob LeVineRob LeVine replied 12 months ago

I'd be lying if I said I understand that. If you want to clarify, I'd like to see a complete user scenario where this would be used, e.g., user does A and then B and then...

I'm guessing what you want to do is possible, either via jQuery and PHP or just PHP, but I'm going to hold out hope that it's even easier than that.

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