Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How to add a onSubmit attribute to login form [solved]

edited January 2011 in Vanilla 2.0 - 2.8

I've used nyromodal to show the login page instead of going to different page. Its working perfectly. Once the user clicks proceed after entering username and password the page will be redirected to control panel. I want to perform a javascript validation on this login window.

Because the page will be redirected if the user clicks the proceed button with out entering the credentials.

How can i add a 'onSubmit' attribute to the form tab?


  • Options
    edited January 2011

    $('#FormName').submit(function() {
    // Perform validation

    // return false if failed to prevent submission and redirection
    If this is vanilla 2 related then this is already a feature. The login page will show in a modal window.
  • Options
    edited January 2011
    Thnak you very much for the reply garymardell .

    i'm using vanilla 1.1.10 . And I'm calling the login page from the sites home page.

    The login page will be loaded once the user clicks the sign-in link. Therefore I cannot add the "$('#FormName').submit" function in the parent page. Unfortunately i could find a callback function for the nyromodal either.Otherwise i could call the "$('#FormName').submit" from the call back function.

    can i add this script in the people_signin_form_nopostback.php ?
  • Options
    I think i have resolved it, i had to use jquerys live() method.
    Thank you garymardell .
Sign In or Register to comment.