ugotjelly
Forum Replies Created
-
@wpmudevsupport3 Hi, so is the first block of code meant to go in a php file? Because I right now its in my wordpress block, and i have probably 50 ajax requests like that all over the website. it will be ttmie consuming and impact performance negatively if i added another request to every select request. It would be easier if i can just turn off validation someway.. please add it to the next update. Because yesterday’s update broke my dynamically filled select’s again =/ Thx
Yes I do still have this issue. Sorry I was busy and didn’t have time to reply to this thread. So like the file got changed today and re-enabled my validation again even though I don’t see an update in the changelog on forminator..
“combine the existing JS code with a PHP snippet for validating dynamically added options ” How would I go about doing that?
Here is my code for modifying the field options:
let modal = jQuery('#addTaskModal'); jQuery.ajax({ type: 'POST', url: '../custom_scripts/get_clients.php', dataType: 'json', success: function(data) { modal.find('select[name="select-1"]').html('Select a client'); jQuery.each(data, function(idx, value) {
modal.find('select[name="select-1"]').append(<option value="${value.id}">${value.client_name}</option>
);}); modal.modal('show'); resetTaskForm(modal); }, async: false });
Edit: It looks like the code block removed my ` backtick quotes in the append() statement
Thank you for the help.
Hmm would you know which specific hook/filter I should be adding to? I don’t see one which I could overwrite the validation.. If I add filter to the one called ‘forminator_select_field_nonexistent_validation_message’ wouldnt that just be changing the message right?
So lets say I do the mu-plugin like you said, then I would need a way to unset $this->validation_message for it to validate right? But I’m not sure how I can access this variable from my plugin.
Please let me know if I’m understanding it correctly. In the meanwhile I’ll keep looking a bit more for an answer.
@wpmudev-support7 Thanks for the timely response! I will be sure to check those links out.
- This reply was modified 7 months, 2 weeks ago by ugotjelly.