
wordpress custom form not able to submit or not able to get form post data in wordpress
I just designed custom form for my client requirement in WordPress. It has some common fields like name, email, phone, file & other fields. When I tried to submit, I found which something weird was – I was not able to get POST value of name, email. Is it not very strange?
After bit researched I found thing which is really interesting which I would like to share here.
WordPress kept few post variables reserved for it self, in such case if you use those variables in your custom form you won’t get its POST value. In my case I was trying text box <input type=”text” name=”name”> here ‘name’ is reserved for WordPress so I was not able get its value. So I renamed its name to “clientname” <input type=”text” name=”clientname”>, then I was able to get post value of “clientname”, So its needed some prefix or postfix for more generic form fields like name, email, phone, file etc…
In summary, most generic form fields like name, email, file for Form are reserved for WordPress, you can’t use those form fields in custom form. You need to rename( by adding postfix/prefix) before using of it.
I hope this article will be helpful.