Whenever I input and submit the form fields correctly using #submit_btn
, my values disappear. However, when they are not valid, this issue does not occur. I attempted to address this problem with jQuery:
$('#submit_btn').click(function() {
if($("#register .wpcf7-mail-sent-ok") === true) {
$('#name-007').val('Full Name').show();
$('#email-007').val('Email').show();
$('#phone-007').val('Phone Number').show();
}
});
Unfortunately, the solution did not work as expected.
Update: #register
serves as the parent element while .wpcf7-mail-sent-ok
acts as its child.
Any suggestions or insights on how to resolve this issue?