• Post Reply Bookmark Topic Watch Topic
  • New Topic

changing elements in same Jsp page

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • 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
 
Baps Vakkalagadda
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!