Support reply may delay for 3 weeks due to corona virus outbreak, please send us email to support@pickplugins.com
Ticket for: Job Board Manager
0
Anonymous
Jul 31, 2020 03:57 AM 1 Answers
Member Since Jan 1970
Unsolved Solved Mark as Solved Mark as Unsolved
Subscribed Subscribe Not subscribe
Flag(0)

Hello!
How can I customize the fields (add, delete,...)?

thanks

0 Subscribers
Submit Answer
Please login to submit answer.
1 Answers
Sort By:
Best Answer
1
PickPlugins
Jul 31, 2020
Flag(0)

Welcome to our forum.

Please check this documentation, let me know if you need any help.

https://www.pickplugins.com/documentation/job-board-manager/action-hooks/job_bm_job_submit_form/

Regards

megasnifer
- Aug 06, 2020 06:46 PM
Flag (0)
0

In the base plug in, the salary_type field generates 2 other fields (currency and amount) when its value equal 'fixed'. I have written a code in the same spirit but all fields are displayed at the same time and not conditionnaly. here is my code

/* Display job_type input field */

add_action('job_bm_job_submit_form', 'job_bm_job_submit_form_job_type', 30);

function job_bm_job_submit_form_job_type(){

$class_job_bm_functions = new class_job_bm_functions();
$job_type_list = $class_job_bm_functions->job_type_list();

$job_bm_job_type = isset($_POST['job_bm_job_type']) ? sanitize_text_field($_POST['job_bm_job_type']) : "";

?>
<div class="form-field-wrap">
<div class="field-title"><?php _e('Type d\'offre','job-board-manager'); ?></div>
<div class="field-input">
<select name="job_bm_job_type" >
<?php
if(!empty($job_type_list)):
foreach ($job_type_list as $job_type => $job_type_name){

$selected = ($job_bm_job_type == $job_type) ? 'selected' : '';

?>
<option <?php echo $selected; ?> value="<?php echo esc_attr($job_type); ?>"><?php echo esc_html
($job_type_name); ?></option>
<?php
}
endif;
?>
</select>
<p class="field-details"><?php _e('Que recherchez-vous en postant cette offre?','job-board-manager'); ?></p>

</div>
</div>
<style type="text/css">
<?php

if($job_bm_job_type =='fusion'){
?>
.montant_a_lever, .montant_de_cession, .nombre_associes, .montant_currency{
display: none;
}
<?php
}elseif ($job_bm_job_type =='Partenariat'){
?>
.montant_a_lever, .montant_de_cession, .montant_currency{
display: none;
}
<?php
}elseif ($job_bm_job_type =='associer'){
?>
.montant_a_lever, .montant_de_cession, .montant_currency{
display: none;
}
<?php
}elseif ($job_bm_job_type =='vendre-son-affaire'){
?>
.montant_a_lever, .nombre_associes{
display: none;
}
<?php
}elseif ($job_bm_job_type =='levee-de-fonds'){
?>
.montant_de_cession, .nombre_associes{
display: none;
}
<?php
}

?>

</style>

<?php
}
add_action('job_bm_job_submit_form', 'job_bm_job_submit_form_montant_a_lever', 30);

function job_bm_job_submit_form_montant_a_lever(){

$job_bm_montant_a_lever = isset($_POST['job_bm_montant_a_lever']) ? sanitize_text_field($_POST['job_bm_montant_a_lever']) : "";
$job_bm_job_type = isset($_POST['job_bm_job_type']) ? sanitize_text_field($_POST['job_bm_job_type']) : "";

?>
<div class="form-field-wrap montant_a_lever" <?php if($job_bm_job_type =='levee-de-fonds'): ?> style="display: block" <?php endif; ?>>
<div class="field-title"><?php _e('Montant à lever','job-board-manager'); ?></div>
<div class="field-input">
<input placeholder="<?php echo __('50000','job-board-manager'); ?>" type="text" value="<?php echo $job_bm_montant_a_lever; ?>" name="job_bm_montant_a_lever">
<p class="field-details"><?php _e('Indiquez le montant que vous souhaiter lever, ex: 1200','job-board-manager');
?></p>
</div>
</div>
<?php
}

add_action('job_bm_job_submit_form', 'job_bm_job_submit_form_montant_de_cession', 30);

function job_bm_job_submit_form_montant_de_cession(){

$job_bm_montant_de_cession = isset($_POST['job_bm_montant_de_cession']) ? sanitize_text_field($_POST['job_bm_montant_de_cession']) : "";
$job_bm_job_type = isset($_POST['job_bm_job_type']) ? sanitize_text_field($_POST['job_bm_job_type']) : "";

?>
<div class="form-field-wrap montant_de_cession" <?php if($job_bm_job_type =='vendre-son-affaire'): ?> style="display: block" <?php endif; ?>>
<div class="field-title"><?php _e('Prix de vente','job-board-manager'); ?></div>
<div class="field-input">
<input placeholder="<?php echo __('50000','job-board-manager'); ?>" type="text" value="<?php echo $job_bm_montant_de_cession; ?>" name="job_bm_montant_de_cession">
<p class="field-details"><?php _e('Indiquez le prix auquel vous souhaiter vendre, ex: 1200','job-board-manager');
?></p>
</div>
</div>
<?php
}

add_action('job_bm_job_submit_form', 'job_bm_job_submit_form_nombre_associes', 30);

function job_bm_job_submit_form_nombre_associes(){

$job_bm_nombre_associes = isset($_POST['job_bm_nombre_associes']) ? sanitize_text_field($_POST['job_bm_nombre_associes']) : "";
$job_bm_job_type = isset($_POST['job_bm_job_type']) ? sanitize_text_field($_POST['job_bm_job_type']) : "";

?>
<div class="form-field-wrap nombre_associes" <?php if($job_bm_job_type =='associer'): ?> style="display: block" <?php endif; ?>>
<div class="field-title"><?php _e('Nombre d\'associés','job-board-manager'); ?></div>
<div class="field-input">
<input placeholder="<?php echo __('3','job-board-manager'); ?>" type="text" value="<?php echo $job_bm_nombre_associes; ?>" name="job_bm_nombre_associes">
<p class="field-details"><?php _e('Indiquez le nombre d\'associés recherchés pour cette offre, ex: 2','job-board-manager');
?></p>
</div>
</div>
<?php
}

add_action('job_bm_job_submit_form', 'job_bm_job_submit_form_montant_currency', 30);

function job_bm_job_submit_form_montant_currency(){

$job_bm_montant_currency = isset($_POST['job_bm_montant_currency']) ? sanitize_text_field($_POST['job_bm_montant_currency']) : "";

?>
<div class="form-field-wrap montant_currency" >
<div class="field-title"><?php _e('Devise','job-board-manager'); ?></div>
<div class="field-input">
<input placeholder="<?php echo __('USD','job-board-manager'); ?>" type="text" value="<?php echo $job_bm_montant_currency; ?>" name="job_bm_montant_currency">
<p class="field-details"><?php _e('choisissez la devise du montant indiqué, ex: USD','job-board-manager');
?></p>
</div>
</div>
<?php
}

PickPlugins
- Aug 06, 2020 06:31 PM
Flag (0)
0

If you please explain what are you trying to then i could help you better way, sorry to say conditionally field isn't available right now. although you can add your own script to make any field to conditional. we haven't provided this.

megasnifer
- Aug 06, 2020 03:37 PM
Flag (0)
0

Hello, thanks for your help. I am not a developper so it takes some times to catch technical documentation. I have read the documentation. It's usefull but, conditionnal field case is not adressed. Do you have another documentation to do this. I need something like that. if field A == 'good' then display field C else don't display.
Regards

Sign in to Reply
Replying as Submit