Client Side Events

When we use Custom Edit Tag, Client Side Event Stopped Working.

//Custom Edit Tag
<input type="text" placeholder="Mobile No" aria-label="MobileNo" aria-describedby="basic-addon1">



//Client Side Event
{ // keys = event types, values = handler functions
	"keyup": function(e) {
		// Your code
		var scream = this.value;
		if (scream.charAt( 0 ) == '0' ) {
			ew.alert("0 at Start of the Mobile Number not allowed");
			return false;
    }
}
}

Kindly advise ?

As always, please press F12 from your browser, and check whether any Javascript error message from Console section.

Already checked. there is no error in console.

Your Custom Edit Tag needs to have id and name so the client side events can be bound to, e.g.

<input id="{{{id}}}" name="{{{name}}}}" ...>

used like this now, but no effect ?

You need to add data-table and data-field attributes, you may refer to other fields or the original generated code as example.

Now Client Side Events Starts Working.
But now i am unable to save the record.
When we click on Add button, it just return to the same page

You may

  1. Press F12 in your browser to check if there are any JavaScript errors in the Console panel,
  2. Enable Debug and check PHP errors.