Presently, I am encountering an issue with my form:
<table class="widefat" ng-app="myApp" ng-controller="MyCtrl">
<tr>
<td><label for="name_pokemon"><?php _e( "Name", "cpt" ); ?></label></td>
<td><input id="name_pokemon_val" maxlength="{{a1Max}}" name="name_pokemon" type="text" ng-model="a1" ng-change="update()" value="<?php echo esc_textarea( get_post_meta($post->ID, 'name_pokemon', true) ); ?>" placeholder="<?php esc_attr_e( 'Name', 'cpt' ); ?>"></td>
<td>Length: {{a1.length}} Remaining: {{remainingA}}</td>
</tr></table>
My current script configuration is as follows:
<script>
var myApp = angular.module('myApp',[]);
function MyCtrl($scope) {
$scope.a1='';
var maxA = 21;
$scope.update = function() {
$scope.remainingA = maxA - ($scope.a1.length);
$scope.a1Max = maxA;
}
$scope.update();}</script>
After submitting my Custom Post Type, I am facing an issue of the input data being reset.
Could anyone kindly provide guidance on how to resolve this issue?
Thank you in advance for your assistance