DOM Event – Where Does It Go?
-
I want to use a DOM function to copy the contents of one field to another field before submission. The code I wrote is:
document.addEventListener( 'wpcf7submit', function( event ) { var homePhone = document.getElementById("CellNumber").value; document.getElementById("HomeNumber").value = homePhone; }, false );
Two questions. 1.) Does this look correct? 2.) Where does the code go? In the functions.php file or the Additional Settings tab of the form, or somewhere else?
Thanks.
The page I need help with: [log in to see the link]
- The topic ‘DOM Event – Where Does It Go?’ is closed to new replies.