• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

changing elements in same Jsp page

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a requirement where I need to display
text field ,submit ,reset button and also "Show list" btn

If the user enters deptno in text field and presses submit ..action is deptlist.do
What I need is when I click "show list" I want to open the same page
but the text field must not be there instead a list box must be displayed
and need the same submit and reset btns and the action element is same deptlist.do.

Is this possible
Can some one give me idea
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is possible. Use a flag variable to track the status (submission type).
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
****How do I pass/change the flag on button click

test.jsp
"<"% int flag =0 ;%">"
"<"FORM name="dept_frm" method="Post" action="dept.do"">"
"<"%
if(flag==1){
%">"

"<"SELECT name="dept_code"">"
"<"OPTION value="-1"">"100"<"/OPTION">"
"<"OPTION value="-1"">"200"<"/OPTION">"
"<"/Select">"

"<"%
}else{
%">"
"<"input name = dept_code value = Enter /">"
"<"form action = test.jsp/">"
"<"input type=submit name=action value="show list"
"onClick flag = 1" /">" click
"<"/form">"
"<"%}%">"

"<"input type=submit name=action value="Login"">"
"<"/form">"

[ August 25, 2004: Message edited by: shan javan ]
[ August 25, 2004: Message edited by: shan javan ]
 
30 seconds to difuse a loaf of bread ... here, use this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic