Rosie33 Posted March 15, 2020 Share Posted March 15, 2020 Site URL: https://www.dlopezlaw.com/es/comunicacion I am creating a multilingual site and have managed to do everything I need it to do except changing the time caption (Hour and Minute to Hora and Minuto) on the contact form on the Spanish version. I was able to follow a previous question to change the first name and last name caption but can't figure out how to do the same for the Hour and Minute (I am hiding the second option). Link to comment
tuanphan Posted March 15, 2020 Share Posted March 15, 2020 Add to Page Settings > Advanced > Header <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> jQuery(function($){ $(".field.hour.two-digits input").html(function() { return $(this).html().replace("Hour", "new hour text"); }); $(".field.minute.two-digits input").html(function() { return $(this).html().replace("Minute", "minute new text"); }); }); </script> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Rosie33 Posted March 15, 2020 Author Share Posted March 15, 2020 Thank you! I tried to add it to the code I already had in there for the first name and last name translation and it is not working. Any thoughts? Here is what I currently have: <script> function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); } } } addLoadEvent(function() { sqsFirstName = document.getElementsByClassName("caption")[0].innerHTML; myFirstName = sqsFirstName.replace("First Name", "Primer nombre"); document.getElementsByClassName("caption")[0].innerHTML = myFirstName; sqsLastName = document.getElementsByClassName("caption")[1].innerHTML; myLastName = sqsLastName.replace("Last Name", "Apellido"); document.getElementsByClassName("caption")[1].innerHTML = myLastName; }); </script> Link to comment
tuanphan Posted March 15, 2020 Share Posted March 15, 2020 Keep my code & let me know. I will check again Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Rosie33 Posted March 15, 2020 Author Share Posted March 15, 2020 Added it back and I still don't see a change. Thanks in advance for your help. Link to comment
tuanphan Posted March 15, 2020 Share Posted March 15, 2020 1 hour ago, Rosie33 said: Added it back and I still don't see a change. Thanks in advance for your help. Remove code I sent and use this <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> jQuery(function($){ $(".field.hour.two-digits .caption").html(function() { return $(this).html().replace("Hour", "new hour text"); }); $(".field.minute.two-digits .caption").html(function() { return $(this).html().replace("Minute", "minute new text"); }); }); </script> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Rosie33 Posted March 16, 2020 Author Share Posted March 16, 2020 It's still not updating the caption. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.