Reputation: 110
Prevent html elements on inline edit Datatables
<td class="sorting_1">
<input type="checkbox">
<i class="fa fa-cubes"></i>
Text Field
</td>
DataTable editor
$('#dynamic-table').on('click', 'tbody td', function (e) {
editor.inline(this);
});
Upvotes: 0
Views: 722
Reputation: 3534
There are a number of ways you can do it. You can use a CSS/jQuery selector to find the first td elements in each tr and get the input element from them, and wire a jQuery blur event to them to strip disallowed characters (i.e. anything that's not alphanumeric) and / or warn/prevent user on blur, depending on how you want to handle it. You may also be able to use add a pattern attribute to input elements and provide a regex to do the same.
Upvotes: 1