• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using button how to write condition

 
saravanan rajendran
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i beginner for this, i created one button in servlet code using HTML when i pressed that button one text have to print eg "welcome" please give idea i new to this
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two very different ways that an HTML button can do something. First, it can send a new HTTP request back to the server; another servlet (or some such) can then send back a page that says "Hello". That new page can replace the existing one, be shown in a new tab or window, be shown in an IFRAME, or (using Javascript) it can be integrated into the existng page.

The other way is to use Javascript. In this case, all the code executes in the browser. You could display your message in any of the ways noted above, or in a Javascript alert box.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic