Formidable Forms custom validation
Budjetti $8-15 USD / tunti
- Freelancer
- Työtehtävät
- PHP
- Formidable Forms custom validation
Hi,
I need to have a custom validation for my formidable forms. I found this code [login to view URL] that validates to make sure a combination of 2 fields is unique and otherwise does not allow submission. I need to have it so that it validates THREE fields to be unique.
I will pay for 1 hour of work as you quote in your application.
Please only apply if you have extensive knowledge of formidable forms and can help me straight away. Do not apply if you simply think you can kinda figure it out. I can provide you with my form export to test at your end or maybe you can just see the error in my code below and correct it for me.
I have adjusted Formidable code to below but it does not work. I does not pick up that there is an entry already that matches all 3 conditions and continues to allow the user to submit an entry:
add_filter('frm_validate_field_entry', 'two_fields_unique', 10, 2);
function two_fields_unique( $errors, $posted_field ) {
$first_field_id = 6; // change 125 to the id of the first field
$second_field_id = 8; // change 126 to the id of the second field
$third_field_id = 17; // change 126 to the id of the second field
$current= current_time("timestamp");
$todaydate = date('Y-m-d', $current);
if ( $posted_field->id == $first_field_id ) {
$entry_id = isset( $_POST['id'] ) ? absint( $_POST['id'] ) : 0;
$values_used = FrmDb::get_col( 'frm_item_metas',
array( 'item_id !' => $entry_id,
array( 'or' => 1,
array( 'field_id' => $first_field_id, 'meta_value' => $_POST['item_meta'][ $first_field_id ] ),
array( 'field_id' => $second_field_id, 'meta_value' => 'Pending' ),
array( 'field_id' => $third_field_id, 'meta_value' => $todaydate ),
)
), 'item_id', array('group_by' => 'item_id', 'having' => '(COUNT(*) > 1)' )
);
if ( ! empty( $values_used ) ) {
$errors[ 'field'. $first_field_id ] = '<b>No multitasking!</b> <br>Complete your active task if you want to add another one.';//.implode(" ",$values_used);
//$errors[ 'field'. $second_field_id ] = 'You have already selected that option';
}
}
return $errors;
}
32 freelanceria on tarjonnut keskimäärin $81/tunti tähän työhön
Hello there, We are here to provide you best development and designing services. We are a team of full stack developers having 14+ years of experience in designing and developing websites/web applications on differen Lisää
Hello Polina H., Yes I have 10 years of experience in PHP, WordPress. can you please start chat and give me more details. Thank you
Hi, We are a team and have checked your requirement 'Formidable Forms custom validation'. We are ready to sign NDA, If required. Websites: [login to view URL] [login to view URL] https://get Lisää
Hello, I can a custom validation for your formidable forms. I am a PHP expert and have worked on many sites in technologies like E-commerce, Wordpress, Woocommerce, Shopify, HTML5 and also PHP frameworks like Laravel, Lisää
***WORDPRESS EXPERT*** Hello, Warm Greetings! I have checked your requirements for the project. I found my skills are relevant to your project. I have more than 6 years of experience in this field and I am highly pro Lisää
Greetings Client I have gone through your project description. I would like to express my genuine interest to be associated with you. I would like to mention that I am a professional having experience in the field of Lisää
Hi your project detail make all sense, thank you for writing proper details, I will work on that form add proper validation and make it work accoring to your need. Thank You
Hello, I am a Full-Stack Web developer and designer with 6+ years of experience in all aspects of web design and development. I am working on WordPress, Joomla, Shopify, Woocommerce, Laravel, CodeIgniter, HTML5, CSS3, Lisää
Hello As a PHP full stack developer, I have been working on 300+ Wordpress projects for the past 10 years. Would you check the following WP websites I developed? [login to view URL] [login to view URL] https://www.m Lisää