Custom Fields
Support General disable user from submitting mobile and email in text area using frontend form

  • Creator
  • #13781

    Hi There i am looking for a solution if some body type mobile number or email address to submit form
    so that the form must not submit how to disable user if he type mobile or email in text area. before form submit using frontend form submit plugin

Viewing 1 replies (of 1 total)
  • Author
  • #13793
    Anh Tran


    I think this can be done with custom JavaScript only. So you need to enqueue your JS file on the page that has the form, then in the code, when the form is being submitted, check if the value of the textarea is a mobile number or email address. If it is, then return false to prevent the submission.

    This is a pseudo-code that might give you some idea:

    jQuery( function( $ ) {
        $( '.your-form' ).on( 'submit', function() {
            var value = $( '#your-field' ).val();
            if ( checkIfIsMobileNumberOrEmail( value ) ) {
                return false;
        } );
    } );
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.