Hello @somosgrow ,
Please try this code snippet:
<?php
add_action( 'wp_footer', 'wpmudev_website_field_custom_validate', 9999 );
function wpmudev_website_field_custom_validate() {
global $post;
if ( is_a( $post, 'WP_Post' ) && !has_shortcode( $post->post_content, 'forminator_form' ) ) {
return;
}
?>
<script type="text/javascript">
jQuery( document ).ready( function($){
setTimeout(function() {
$('.forminator-custom-form').trigger('after.load.forminator');
},100);
$(document).on('after.load.forminator', function(event, form_id) {
if ( event.target.id = 'forminator-module-6' ) {
$.validator.addMethod("urlvalid", function (value, element) {
if ( value.indexOf("https://") == 0 ) {
return true;
}
return false;
},"The URL must contain https.");
$( "#url-1 input" ).attr( "urlvalid", "urlvalid" );
}
});
});
</script>
<?php
}
In the code here forminator-module-6 need to change 6 to your form ID.
You can place it as MU plugin https://premium.wpmudev.org/docs/getting-started/download-wpmu-dev-plugins-themes/#installing-mu-plugins
kind regards,
Kasia