Insert Website URL without adding http or https

When a visitor enters a URL on the form on the front-end of the site, they can’t submit the form unless there is an “http://” OR “https://” in the field.

Second question, I would like to collect email addresses from this slide in, but I need to get notified when a new email address is submitted via this slide-in.

Is there a way to do this, similar to the way Forminator sends an email after a form submission?

  • Ash
    • WordPress Hacker

    Hello Brad

    You can disable default HTML validation for website using the following code:

    add_action( 'wp_footer', function() {
    ?>
    <script>
    jQuery( document ).ready(function( $ ) {
    $( '.hustle-modal-optin_form' ).attr( 'novalidate', 'novalidate' );
    });
    </script>
    <?php
    } );

    You can use this code in your child theme’s functions.php if the theme is not changed. Otherwise mu-plugin is the best option. To create a mu-plugin, go to wp-content/mu-plugins folder. If there is no mu-plugins folder then, create one. Now, inside the mu-plugins folder create file with name anything.php (make sure file extension is .php). Now start with a <?php tag and then put the above code.

    Second question, I would like to collect email addresses from this slide in, but I need to get notified when a new email address is submitted via this slide-in.

    Is there a way to do this, similar to the way Forminator sends an email after a form submission?

    I am afraid, this is not possible out of the box I had a talk with the developer and this could be a potential feature in one of the next versions.

    We may try to use a hook to send a simple email. Will it be okay for now? Please let us know.

    Have a nice day!

    Cheers,

    Ash

  • Brad
    • Flash Drive

    Worked perfectly! Can I put in a request to add this natively? I think that less-web savvy users may not know they are supposed to add “http://” and will give up without submitting.

    Also, I was able to stay with the Hustle email collection form and receive a notification from MailChimp when a new address is added via this slide-in by setting it to submit to a specific MailChimp Audience. Email notifications for new submissions would be another great Hustle feature!

    Thanks.

  • Nithin
    • Support Wizard

    Hi Brad,

    Can I put in a request to add this natively? I think that less-web savvy users may not know they are supposed to add “http://” and will give up without submitting.

    Yes, I do agree this could be a handy addition. I’m bringing this into our team’s attention so that they could check the possibilities of implementing this down the roadmap.

    Also, I was able to stay with the Hustle email collection form and receive a notification from MailChimp when a new address is added via this slide-in by setting it to submit to a specific MailChimp Audience. Email notifications for new submissions would be another great Hustle feature!

    With MailChimp, the subscription notifications can be controlled in the MailChimp side:

    https://mailchimp.com/help/change-subscribe-and-unsubscribe-notifications/

    I suppose you meant email notifications for submissions in “Local Hustle List”, right? I’m passing this feedback to your team too.

    Thanks for your feedback. Really appreciate. Have a nice day ahead. :slight_smile:

    Regards,

    Nithin

  • Brad
    • Flash Drive

    Nithin,

    After the recent changes to Hustle, this method no longer works. I tried changing “.hustle-modal-optin_form” to other CSS selectors targeting the input field, but not worked.

    My visitors will enter “www.website.com” and see the “please enter a URL” message, and they’ll give up. Many of these people aren’t savvy enough to enter http://.

    Please help with this code and implement in the next version of Hustle.

  • Nithin
    • Support Wizard

    Hi Brad,

    It seems like with the new plugin update the class name has changed. Please replace the above-given code with the following one, and it should work fine:

    <?php
    add_action( 'wp_footer', function() {
    ?>
    <script>
    jQuery( document ).ready(function( $ ) {
    $( '.hustle-layout-form' ).attr( 'novalidate', 'novalidate' );
    });
    </script>
    <?php
    } );

    I gave a quick test in my system, and it works fine now. We have already brought this feature request into our team’s attention, and our developer does seem this to be a good feature. At the moment, I’m afraid there isn’t any exact ETA but it’s something which we are looking forward to implementing down the roadmap.

    Kind Regards,

    Nithin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.