OnClick - is there any opposite?

K

KDawg44

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="editNote(noteID);" onClickOut="diplayNote(noteID)";

onClick works but is there something like onClickOut?

Thanks.
 
K

KDawg44

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="editNote(noteID);" onClickOut="diplayNote(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...
 
D

Doug Gunnoe

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.
 
E

Evertjan.

KDawg44 wrote on 04 apr 2008 in comp.lang.javascript:
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.
 
B

Bart Van der Donck

KDawg44 said:
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?

The onClick-event could have two pillars:
- show the Textarea of the clicked cell
- hide Textareae of every other cell

Cheers,
 
D

Doug Gunnoe

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. :>
 
K

KDawg44

The onClick-event could have two pillars:
- show the Textarea of the clicked cell
- hide Textareae of every other cell

Cheers,

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.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top