Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enviar = ( t ) => {
- let url = t.action;
- let method = t.method;
- let idForm = t.id;
- let formElement = document.getElementById(idForm);
- let formData = new FormData( formElement );
- grecaptcha.ready(function() {
- $( ".form-control" ).prop( "readonly" , true );
- Toast.fire({
- icon: 'warning',
- title: 'Espere, enviando'
- });
- grecaptcha.execute(public_key, {action: 'contact'}).then( function( token ) {
- formData.append("token", token);
- axios({
- method: method,
- url: url,
- data: formData,
- responseType: 'json',
- config: { headers: {'Content-Type': 'multipart/form-data' }}
- })
- .then(res => {
- if (parseInt(res.data.estado)) {
- } else {}
- })
- .catch(err => {})
- .then(() => {});
- });
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement