Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"Edit in Place" Using Simple JS

 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I'm making a simple "Edit In Place" for my web app, Here is the current scenario

Edit it



When I click "EDIT" button, JS replace "name", "surname" fields to <input type="text"> and button EDIT replaced by button "UPDATE"
and this UPDATE button call AJAX.


If user clicks the "EDIT", button, the input fields are shown, Now I want to make this input fields hidden again if the user clicks anywhere else on body screen, How can implement this ?

I tried to use
But the problem is, it consider any click, including the click on "EDIT and "UPDATE" button, which I don't want !!
Any inputs??
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basic idea:



Eric
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic