OnClick - is there any opposite?

Discussion in 'Javascript' started by KDawg44, Apr 4, 2008.

  1. KDawg44

    KDawg44 Guest


    I have a series of notes in the cells of a table, when they click the
    note, it calls a function that creates a text area for the user to
    edit the note in. What I would like to do is have it so when they
    click outside the text area, it calls another function that changes it
    back to a cell displaying the data with the changes.

    Is there anyway to do this? Something like:

    onClick="editNote(noteID);" onClickOut="diplayNote(noteID)";

    onClick works but is there something like onClickOut?

    KDawg44, Apr 4, 2008
    1. Advertisements

  2. KDawg44

    KDawg44 Guest

    Nevermind... it wouldn't even make sense to have something like
    this.... then everytime they click outside the span or div it would
    call that...

    dumb question...
    KDawg44, Apr 4, 2008
    1. Advertisements

  3. KDawg44

    Doug Gunnoe Guest

    You could use onblur() for the text area to trigger the behavior
    you're after.

    But another option would be to have a button labeled update and the
    user can update the info when they're finished making an edit by
    clicking the button.
    Doug Gunnoe, Apr 4, 2008
  4. KDawg44

    G Guest

    SEE THIS: http://www.quirksmode.org/dom/cms.html
    G, Apr 4, 2008
  5. KDawg44

    Evertjan. Guest

    KDawg44 wrote on 04 apr 2008 in comp.lang.javascript:
    The opposite of onclick must be onNotClick.

    [No the date is not April first]

    This is easily implemented by resetting/restarting a timeout on every
    Evertjan., Apr 4, 2008
  6. The onClick-event could have two pillars:
    - show the Textarea of the clicked cell
    - hide Textareae of every other cell

    Bart Van der Donck, Apr 5, 2008
  7. KDawg44

    Doug Gunnoe Guest

    You may have missed April 1 a bit, but still, lol.

    How about a onNotLoad event?
    This way when a visitor does not come to your site, you can open a
    nasty pop up window on them. :>
    Doug Gunnoe, Apr 5, 2008
  8. KDawg44

    KDawg44 Guest

    I thought of this but then if they want to go back and click somewhere
    in the textarea to make a change, it will commit what they have

    I simply added link that says DONE which calls the function. This
    seems to be working fine... though my AJAX calls seem to work three
    times then stop working... but that's another problem.


    Thanks for everyone's help and suggestions.
    KDawg44, Apr 7, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.