Home › Forums › Quform WordPress › Quform Custom Code to various forms
- This topic has 2 replies, 2 voices, and was last updated 6 years, 8 months ago by burgmestre.
- AuthorPosts
- July 15, 2017 at 10:47 am #21481burgmestreParticipant
Hi,
I’ve created 4 different forms on my website (one for each language). In these forms, I need to use an e-mail validator, and change the path of the uploaded files.
I’ve followed your guides using Quform Custom Code. But my problem is that is working only with one form. When I want to configure for the others, it stops working.
This is an example: when I configure the Custom Code with this parameters, it is working:
?php/*
* Plugin Name: Quform Custom Code
* Description: Custom code for Quform.
* Version: 1.0
*/// Paste in your custom code below
function my_override_upload_path($path, $element)
{
$name = $element->getForm()->getValue(‘iphorm_12_35’);
$name = sanitize_file_name($name);return “espectacle/$name/”;
}
add_filter(‘iphorm_upload_path_12’, ‘my_override_upload_path’, 10, 2);—————————
But if I try to put the information of the other forms, it isn’t working:
?php
/*
* Plugin Name: Quform Custom Code
* Description: Custom code for Quform.
* Version: 1.0
*/// Paste in your custom code below
function my_override_upload_path($path, $element)
{
$name = $element->getForm()->getValue(‘iphorm_12_35’);
$name = sanitize_file_name($name);return “espectacle/$name/”;
}
add_filter(‘iphorm_upload_path_12’, ‘my_override_upload_path’, 10, 2);
function my_override_upload_path($path, $element)
{
$name = $element->getForm()->getValue(‘iphorm_13_35’);
$name = sanitize_file_name($name);return “espectacle/$name/”;
}
add_filter(‘iphorm_upload_path_13’, ‘my_override_upload_path’, 10, 2);
function my_override_upload_path($path, $element)
{
$name = $element->getForm()->getValue(‘iphorm_16_35’);
$name = sanitize_file_name($name);return “espectacle/$name/”;
}
add_filter(‘iphorm_upload_path_16’, ‘my_override_upload_path’, 10, 2);
function my_override_upload_path($path, $element)
{
$name = $element->getForm()->getValue(‘iphorm_17_35’);
$name = sanitize_file_name($name);return “espectacle/$name/”;
}
add_filter(‘iphorm_upload_path_17’, ‘my_override_upload_path’, 10, 2);————
What is my mistake?
Thanks,
Arnau
July 21, 2017 at 5:51 pm #21501AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- This reply was modified 6 years, 8 months ago by Ally.
July 25, 2017 at 5:04 pm #21518burgmestreParticipantOk, now it’s fixed and solved. Thanks!
- AuthorPosts
- You must be logged in to reply to this topic.