Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

showing one form if the other form is submitted

 
aliya sharma
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I want to have one form with just the username textfield when the page is first loaded. When the user fills in that textfield and press submit, only then i want another form containing the username and description text field to show up in the same page. I know how to get the values from the database. I just don't know how to show the second form only if the user submits the first form. How can i achieve this with javascript. I'ts very important. Any suggestions or related code would be greatly appreciated. Thanks a lot.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You shouldn't be using JavaScript to perform this action.

What language are you using to chck to see if the user name and password is correct?

Eric
 
aliya sharma
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Eric,

username is a field in the table..Im using CMP bean to hold that table..it displays the description field after i submit the username. I know how to do that.For example: In the first form , where theres only one text element..i pass that to the bean. String username = request.getParameter("username"); and then UserAccessBean user = new UserAccessBean(username). BUt only after i press submit, i want the other form that shows the username and description to show up(that form will have a update button to update the database, i nkow how to do that as well)..I don't know how to display the second form only when the first one is submitted..My page holding these form is JSP
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should have the server side code add the code to the page since you can not rely on JavaScript to be enabled by the user. If JavaScript is disabled, then they will not be able to see the second form.

You should use server side includes.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic