Connecting Tech Pros Worldwide Help | Site Map

OnClick - is there any opposite?

KDawg44
Guest
 
Posts: n/a
#1: Apr 4 '08
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.
KDawg44
Guest
 
Posts: n/a
#2: Apr 4 '08

re: OnClick - is there any opposite?


On Apr 4, 1:00 pm, KDawg44 <KDaw...@gmail.comwrote:
Quote:
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...

Doug Gunnoe
Guest
 
Posts: n/a
#3: Apr 4 '08

re: OnClick - is there any opposite?


On Apr 4, 11:04 am, KDawg44 <KDaw...@gmail.comwrote:
Quote:
On Apr 4, 1:00 pm, KDawg44 <KDaw...@gmail.comwrote:
>
Quote:
Hi,
>
Quote:
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.
>
Quote:
Is there anyway to do this? Something like:
>
Quote:
onClick="editNote(noteID);" onClickOut="diplayNote(noteID)";
>
Quote:
onClick works but is there something like onClickOut?
>
Quote:
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.
G
Guest
 
Posts: n/a
#4: Apr 4 '08

re: OnClick - is there any opposite?


On Apr 4, 1:04 pm, KDawg44 <KDaw...@gmail.comwrote:
Quote:
On Apr 4, 1:00 pm, KDawg44 <KDaw...@gmail.comwrote:
>
Quote:
Hi,
>
Quote:
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.
>
Quote:
Is there anyway to do this? Something like:
>
Quote:
onClick="editNote(noteID);" onClickOut="diplayNote(noteID)";
>
Quote:
onClick works but is there something like onClickOut?
>
Quote:
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
Evertjan.
Guest
 
Posts: n/a
#5: Apr 4 '08

re: OnClick - is there any opposite?


KDawg44 wrote on 04 apr 2008 in comp.lang.javascript:
Quote:
On Apr 4, 1:00 pm, KDawg44 <KDaw...@gmail.comwrote:
Quote:
>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...
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)
Bart Van der Donck
Guest
 
Posts: n/a
#6: Apr 5 '08

re: OnClick - is there any opposite?


KDawg44 wrote:
Quote:
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,

--
Bart
Doug Gunnoe
Guest
 
Posts: n/a
#7: Apr 5 '08

re: OnClick - is there any opposite?


On Apr 4, 3:00 pm, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
Quote:
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. :>

KDawg44
Guest
 
Posts: n/a
#8: Apr 7 '08

re: OnClick - is there any opposite?


On Apr 5, 9:05 am, Bart Van der Donck <b...@nijlen.comwrote:
Quote:
KDawg44 wrote:
Quote:
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.
>
Quote:
Is there anyway to do this? Something like:
>
Quote:
onClick="editNote(noteID);" onClickOut="diplayNote(noteID)";
>
Quote:
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.
Closed Thread


Similar JavaScript / Ajax / DHTML bytes