• 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

Code checks "submit" type button

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The code "if(request.getParameter("post") != null )" and "if(request.getParameter("addBulletin") != null" is testing whether a button was clicked within jsp. How does a button become not null and with what not null value is it populated? I can't find the answer on google.
Thanks
 
Ivan Turner
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A quick out.println("**"+request.getParameter("post")+"**"); indicated that the value attribute of the input tag not only shows as the button's text but it is also the value associated with getParameter. I didn't need google after all!!!
 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ivan,

The approach with which you are checking the click event of the button is absolutely incorrect.
Make use of javascript or JQuery to check events like button clicked and so on.

If you choose javascript then you may make use of onclick() event of button and then invoke its function for the same.

Let me know if you have any further concerns.

Thanks and Regards,
Ashwini Kashyap
 
reply
    Bookmark Topic Watch Topic
  • New Topic