Javascript to search textboxes

Modified on Fri, Nov 1 at 2:39 PM

If you want to search for specific characters like the @ symbol.

For example if the @domain is already in the postfix of the email block since it is mandatory.


You can use the below javascript in your bootstrap layout.


<script>


    function _initPreview() {


        if ($("[data-blockname='Email']").val().includes("@"))


        {


            alert ("Please don't enter @ into the Email textbox");


            return false;


        }


        return true;


    }


</script>

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article