Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

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 ]
reply
    Bookmark Topic Watch Topic
  • New Topic