OnClick - is there any opposite?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • KDawg44

    OnClick - is there any opposite?

    Hi,

    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="editNo te(noteID);" onClickOut="dip layNote(noteID) ";

    onClick works but is there something like onClickOut?

    Thanks.
  • KDawg44

    #2
    Re: OnClick - is there any opposite?

    On Apr 4, 1:00 pm, KDawg44 <KDaw...@gmail. comwrote:
    Hi,
    >
    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="editNo te(noteID);" onClickOut="dip layNote(noteID) ";
    >
    onClick works but is there something like onClickOut?
    >
    Thanks.
    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...

    Comment

    • Doug Gunnoe

      #3
      Re: OnClick - is there any opposite?

      On Apr 4, 11:04 am, KDawg44 <KDaw...@gmail. comwrote:
      On Apr 4, 1:00 pm, KDawg44 <KDaw...@gmail. comwrote:
      >
      Hi,
      >
      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="editNo te(noteID);" onClickOut="dip layNote(noteID) ";
      >
      onClick works but is there something like onClickOut?
      >
      Thanks.
      >
      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...
      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.

      Comment

      • G

        #4
        Re: OnClick - is there any opposite?

        On Apr 4, 1:04 pm, KDawg44 <KDaw...@gmail. comwrote:
        On Apr 4, 1:00 pm, KDawg44 <KDaw...@gmail. comwrote:
        >
        Hi,
        >
        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="editNo te(noteID);" onClickOut="dip layNote(noteID) ";
        >
        onClick works but is there something like onClickOut?
        >
        Thanks.
        >
        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...

        SEE THIS: http://www.quirksmode.org/dom/cms.html

        Comment

        • Evertjan.

          #5
          Re: OnClick - is there any opposite?

          KDawg44 wrote on 04 apr 2008 in comp.lang.javas cript:
          On Apr 4, 1:00 pm, KDawg44 <KDaw...@gmail. comwrote:
          >Hi,
          >>
          >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="editN ote(noteID);" onClickOut="dip layNote(noteID) ";
          >>
          >onClick works but is there something like onClickOut?
          >>
          >Thanks.
          >
          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...
          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
          click.

          --
          Evertjan.
          The Netherlands.
          (Please change the x'es to dots in my emailaddress)

          Comment

          • Bart Van der Donck

            #6
            Re: OnClick - is there any opposite?

            KDawg44 wrote:
            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="editNo te(noteID);" onClickOut="dip layNote(noteID) ";
            >
            onClick works but is there something like onClickOut?
            The onClick-event could have two pillars:
            - show the Textarea of the clicked cell
            - hide Textareae of every other cell

            Cheers,

            --
            Bart

            Comment

            • Doug Gunnoe

              #7
              Re: OnClick - is there any opposite?

              On Apr 4, 3:00 pm, "Evertjan." <exjxw.hannivo. ..@interxnl.net wrote:
              The opposite of onclick must be onNotClick.
              >
              [No the date is not April first]
              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. :>

              Comment

              • KDawg44

                #8
                Re: OnClick - is there any opposite?

                On Apr 5, 9:05 am, Bart Van der Donck <b...@nijlen.co mwrote:
                KDawg44 wrote:
                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="editNo te(noteID);" onClickOut="dip layNote(noteID) ";
                >
                onClick works but is there something like onClickOut?
                >
                The onClick-event could have two pillars:
                - show the Textarea of the clicked cell
                - hide Textareae of every other cell
                >
                Cheers,
                >
                --
                Bart
                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
                instead.

                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.

                Comment

                Working...