Hi Support,
I have a user form that has two fields one is the organization which is (select type) and another for request status which is (Radio type)
I would like to automatically change the field value of the request status field from rejected to pending at any time the organization field is updated. Check the attached image.
I have displayed the value of the radio only because I don't want the user to change the value.
Hello,
There isn't such kind of built-in feature within Toolset Forms plugin.
You might consider custom codes, for example:
1) After user update organization field value, setup JS codes to trigger AJAX call:
2) In the WordPress server side, get the organization field value, and response related result, and update request status field value
More help:
hidden link
https://codex.wordpress.org/AJAX_in_Plugins
For your reference.
I appreciate if you Could help me to do it since I am not that much familiar with Ajax and Jquery
Please provide a test site with the same problem, also point out the problem page URL and form URL, thanks
Thank for the details, I have done below modifications in your website:
Edit the user form "Update User Form readonly":
hidden link
1) in section "Form Editor", add those two fields into form content:
line 46:
[cred_field field="request-status" force_type="field" class="form-control" output="bootstrap"]
line 36:
[cred_field field="org" force_type="field" class="form-control" output="bootstrap"]
You can use CSS codes to hide above "org" field
2) in section "JS Editor", add below codes:
jQuery(document).on('cred_form_ready', function(){
jQuery( 'select[name="wpcf-org"]' ).change(function() {
jQuery( 'b.wpcf-request-status' ).text('Pending');
jQuery( 'input[name="wpcf-request-status"][value=3]' ).prop("checked",true);;
});
});
Please test again, check if it is what you want, thanks
Many Many thanks yang. your support is highly appreciated. It is working well as I desired.