[Urgent] On submit hook issue
-
Sorry for the urgent, but I’m already way past deadline trying to get this to work and I’ve posted on wp forum in plugins an hacks, stackoverflow, stackexchange and haven’t heard back from anyone. I really need help on this.
I am trying to use the on_submit hook for a jquery function, but at the moment the only time my jquery works is when I don’t put anything in the required fields and it kicks back a validation error. I have a feeling this is because the submit function is firing before my function.
What I need to have happen is on submit, the hidden cf7 fields find their corresponding fields in the inputs on a mortgage calculator in an iframe, and copy the data over to the hidden cf7 fields, then submit the form. Here’s my code.
<script> function clonetxt() { $("input").each(function(){ if ($(this).hasClass("cpy")) { var currId = $(this).attr('id'); var parVal = $('#frame').contents().find('#' + currId).val(); $(this).val(parVal); }; }); }; </script>Is there a way to add something in the scripts.js or submission.php like (extremely roughly) if the submit button has an id of subBtn, then return false and run clonetxt, then add the submit function into clonetxt? If so, where should I put it as to not interfere with what is there already.
I know I will have to re-edit possibly every update, but I can’t find another option. Thank you so much!
The topic ‘[Urgent] On submit hook issue’ is closed to new replies.