Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript How do I make an AJAX rollover button for contact form?

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #24337
    iasiis
    Member

    …………………..

    #54926

    I use the jQuery Form Plugin for AJAX. Download it from here and insert it into the <head> section of your page. Then invoke your form by using the following script:

    Code:

    This script also adds a class of .hover when you rollover the submit button. Actually it will add the class ‘hover’ to any <input> tag within the form that has the class ‘button’. It also removes the ‘hover’ class when the mouse moves out of the button. This enables you to style your button using simple css.

    Code:
    #button {
    background: …;
    }

    #button.hover {
    background: …;
    }

    One final note, in order to make the Ajax plugin work you need to set the form’s action to the actual URL that handles the ajax. This has the added benefit of enabling non-ajax submits when users without javascript visit your site.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.