Forums

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

Home Forums JavaScript jQuery form plugin> onclick handler problem

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #35160
    heartnet
    Member

    when use the below code inside the

    to open the registration page, it don’t work.



    when i put the the javascript separately, it works but by clicking anywhere on the page. i want the onclick event to fire when only clicked on the “register” button. im new to javacript.



    #90623
    akeenlabs
    Participant

    The reason your top code doesn’t work is that on the “onclick” event you define a function. You don’t actually call that function, you just define it. Remove the function definition. Try something like this:

    onclick="document.location.href='register.php';"

    You’re also using double quotes within a double quote delimited string. You should switch to single quotes like I’ve done above.

    Also, if you have not already, check out jQuery. It makes event handling extremely simple and fool-proof, plus there is a lot of support for jQuery on these forums.

    Seems like I’ve answered this same question for you before :)

    #90977
    heartnet
    Member

    yeah, you did and i used this jQuery form plugin http://goo.gl/w0klE
    but onclick handler don’t work when i use this plugin. other wish onclick handler works just fine.

    #90978
    heartnet
    Member

    onclick handler also don’t work when buttons has css color customization applied. i ran into that problem when i was using modal windows last time.

    #93727
    heartnet
    Member

    for now, i’m not using that jQuery form plugin^^… any suggestions on how to make it work?

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