• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Make Active n Inactive button using JavaScript

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm displaying the data in jsp in a table form. One of the column has 'Status' field, which will have 'Active' and 'Inactive' values.

My requirement is, if the status is 'active', a button should be displayed adjacent to it with the value 'Make Inactive'. If I click 'Make Inactive' button, the status should be updated to 'Inactive'. And, if the status is 'Inactive', a button should be displayed with the value 'Make Active'. If I click 'Make Active' button, the status should be updated to 'Active'.

Thanks in advance.

With Regards
Dev Anand. P
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well you can do display: none || inline OR change the buttons value onclick

Eric
 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just curious - why wouldn't you do this in JSP - since you are already aware of the Status when the JSP is being executed/rendered.

Why javascript.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic