[cred_child_link_form form='14194' parent_id='[wpv-post-id item="@movie-character-name.parent"]' text='Create new' target='_self']
this is my link to a form.
In this form the user need to check boxes of the taxonomy 'performance-language".
I want to preselect the boxe with a taxonomy value. How can I do that ?
Instead of a text "create new" I also would like to have a small svg picture as a link.
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Hello. Thank you for contacting the Toolset support.
What checkboxes option you want to pre-selected. What form you have to create new entry or edit exiting entry.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Within your view I've removed the [cred_child_link_form] shortcode using which you display the "Create new" link
=> hidden link
And replaced with the following HTML link:
<a href="/add-new-cast/?parent_movie_id=[wpv-post-id item="@movie-character-name.parent"]&pl=[wpv-search-term param='pl']" target="_self">Create new</a>
You can replace the "Create new" with your required SVG.
To make the checkbox selected I've added the following custom JS code to your form's custom JS editor:
=> hidden link
jQuery(document).ready(function($){
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : sParameterName[1];
}
}
};
var param = getUrlParameter('pl');
//param = param.charAt(0).toUpperCase() + param.slice(1);
console.log(param);
$('input[type="checkbox"][data-value]').each(function() {
if ($(this).data('value').toLowerCase().includes(param)) {
$(this).prop('checked', true);
}
});
});
- You can adjust the code as required if needed.