Problems, need help? Have a tip or advice? Post it here.
2 posts Page 1 of 1
When using plain HTML5 I can specify
Code: Select all
attribute="file.php"
and then via AJAX catch if the submission status was successful something along these lines to clear all input fields.
Code: Select all
$('#contact-us-form').submit(function (e) {
      e.preventDefault();
      var $this = e.target;
      $.ajax({
         data: $($this).serialize(),
         type: 'POST',
         url: $('#contact-us-form').attr('action')
      }).done(function(response){
         e.preventDefault();

         $('input:text, textarea').val('');
      }).fail(function (data){
         e.preventDefault();
         
         console.error(data);
      })
   });


What is the
Code: Select all
attribute
alternative for CouchCMS? And, why
Code: Select all
input type="reset"
is not a valid Couch CMS tag?
You can explicitly set the 'action' parameter to the current page as follows
Code: Select all
<cms:form action="<cms:show k_page_link />"

As for the type='reset', you can use it by defining it in plain HTML i.e. as follows -
Code: Select all
<input type="reset" ..

instead of the Couch's variation that uses "<cms:" before the input.

Hope this helps.
2 posts Page 1 of 1