How to add action for custom form in wordpress?

1.8k views Asked by At

I have created a custom contact form in wordpress page using HTML and give action as "../customer-details.php" .This file located at theme folder. When i click submit on form it returns 404 page does not exist error . Why is this happening ? What is wrong with my action URL ?

Here is the link i used to create form

http://www.inkthemes.com/how-you-can-easily-create-customized-form-in-wordpress

2

There are 2 answers

0
Arjun Rajagopalan On

According to me, the form is having trouble locating the file "../customer-details.php". check again if it is located in the correct folder. Give it a look, not form the WordPress admin panel but from the file directory on your server.
Another solution could be to use short codes to create the form. There are a few pretty wicked forms, that let you do a lot of cool things have a look.
https://wordpress.org/plugins/contact-form-7/
https://wordpress.org/plugins/custom-contact-forms/
https://wordpress.org/plugins/advanced-custom-fields-contact-form-7-field/

I guess that should solve your problem.

0
kfinto On

Try to use action="<?php echo bloginfo('template_url'); ?>/customer-details.php" instead.