What's the best way to get at form values in the pre_submission hook?
I know I can use $_POST['input_5'] or whatever, but that isn't very maintainable.
Also, if I edit my form, the id will change.
Is there a better approach?
What's the best way to get at form values in the pre_submission hook?
I know I can use $_POST['input_5'] or whatever, but that isn't very maintainable.
Also, if I edit my form, the id will change.
Is there a better approach?
Hi John, the $_POST is currently the only way to get the entry values during the gform_pre_submission hook. At this point in the process Gravity Forms has not retrieved the entry values (with a few exceptions) and when it does, it too uses the $_POST.
Hi David
>At this point in the process Gravity Forms has not retrieved the entry values
So is it better to wait for a later hook?
I'm creating a new user, a new post, possibly a new category and sending emails so I need a fair amount of what's in the form (and it's too custom to use your other plug-ins).
It's all working but I don't like the hardcoded elements of the code - we've already changed the form structure twice and it means that no changes can be made using the GF interface since it now relies too much on underlying code.
John
I understand the predicament. One hack-ish way I've added flexibility to this in the past is to use the 'cssClass' property of the field to identify it. For example, if you need to know which field is the username field, just add a class in the admin for the field that will be used as the username. Then the code will be dependent on the class (which could then be updated in the admin freely) without be depending on a field ID.