I went through the solution posted by Mr. J and Ultimater in the beginning.
I have a query about that.
What if we have different form elements (like text boxes, labels, combo, etc) instead of only text (By text, I'm referring to "blah blah content").
Can we expand and collapse the page in the similar fashion which will now show and hide various form elements????
Actually, my main motive is as follows...
A JSP page has around 10 fields in all.User is reqd to compulsorily fill in 5 fields to proceed to next page.
Hence, page is divided in 2 parts, Basic and Advanced.
When page first loads, only the first 5 Basic fields are visible, along with a button "Advanced".When user clicks on "Advanced" all 10 fields are displayed, with button "Basic".On clicking "Basic", first 5 fields visible.
There is only one request through which we come to this page, and there is only one request which we have to send at the end to the servlet (when user clicks button "Submit Form").
Then there are cases when the user fills values in the form and clicks "Advanced".We need to retain those values also when displaying the page.
Can anyone please guide me?