aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes showing one form if the other form is submitted Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "showing one form if the other form is submitted" Watch "showing one form if the other form is submitted" New topic
Author

showing one form if the other form is submitted

aliya sharma
Ranch Hand

Joined: Aug 11, 2004
Posts: 48
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Aug 11, 2004
Posts: 48
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: showing one form if the other form is submitted