form validation and use ajax for pagination