+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / How to modify default action of Submit Button

How to modify default action of Submit Button

5 posts, 0 answered
  1. test
    test avatar
    4 posts
    Registered:
    24 Jun 2016
    16 Aug
    Link to this post

    Hi Everyone,

    I have a page containing Sitefinity Form, i need to modify the default action of button submit on my Form,  how to do that?

    Thanks for any suggestions..

    Regards,

     

    Eddy

  2. Victor Leontyev
    Victor Leontyev avatar
    65 posts
    Registered:
    01 Jul 2014
    16 Aug in reply to test
    Link to this post

    Hi Eddy. You can do it with Javascript. Or do you want to do it on server side?

    $(document).ready(function() {
      $('form').on('submit', function(e){
        // validation code here
        if(!valid) {
          e.preventDefault();return false;
        }
      });
    });

  3. test
    test avatar
    4 posts
    Registered:
    24 Jun 2016
    16 Aug
    Link to this post

    Hi Victor,

    At the first time,  i will try it with javascript

    Thanks for the enlightenments..

    Regards,

    Eddy

     

  4. Aude
    Aude avatar
    0 posts
    Registered:
    23 Aug 2016
    25 Aug in reply to Victor Leontyev
    Link to this post
    Where would you put the javascript? in a file or in Sitefinity? If so where in Sitefinity?
  5. test
    test avatar
    4 posts
    Registered:
    24 Jun 2016
    29 Aug in reply to Aude
    Link to this post

    Hi Aude,

    I think that is not a problem whether we put it within Sitefinity script widget or in an external file(linked in .master file) since sitefinity can access it.

    Regards,

    Eddy

5 posts, 0 answered