Solved

JSP forms + including other JSP Pages

Posted on 2004-04-14
11
462 Views
Last Modified: 2010-04-01
Hello Experts,

How can i make a single SUBMIT query button for 4 forms. (i mean for 3 JSP Pages are included in 1 JSP Page).

Actually i created with a single FORM..but since i am having a lot of fields , i want to split the form and make a single SUBMIT.

The display PAGE mut contain all the form fields and must be able to SUBMIT the values.

If you want, i can explain more detailly.

Regards,
Sam.
0
Comment
Question by:jaggybala1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 92

Expert Comment

by:objects
ID: 10829742
>  i want to split the form and make a single SUBMIT.

why do u want to split the form?
0
 

Author Comment

by:jaggybala1
ID: 10829764
because i have a lot of fields...i am having 2000 lines of coding for form display and form submit action(SQL query to insert/update)...

i am having problems when i try to insert more than certain number of text inputs.(the problem is that the SUBMIT button gets deactivated!!!...donno why, but it happens only if i try to insert more than certain limit of text)

also, its very difficult for me while debugging.
0
 
LVL 92

Expert Comment

by:objects
ID: 10829778
but if you split it into seperate forms then you won't be passing all the the inputs in the one request.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:VRGultom
ID: 10829912
Suggestion:

Make it in 4 page. U can use next or page number. Whenever user finish one page, he can press the next page...

Whenever user press the next page, you have to send the parameters that user type together to next page. It is same with submit but u don't need to save them to database.

Finally u have to retrieve all parameters value after submit in the last page and save it to database.

Without send the parameters value to the next page, you cannot keep them until submit.

Regards
Veronika
0
 

Author Comment

by:jaggybala1
ID: 10830322

any other help/suggestions ...!?

- Thanx.
0
 

Author Comment

by:jaggybala1
ID: 10831025
ok...

now i have to insert  JSP page(thats has some fields) in the other page before the SUBMIT button.

if i use,

out.print("<jsp:include page=\"page2.jsp\" flush=\"true\">");

the page2 is not displaying...
 
does it mean that it is not possible to include a page in a JSP FUNCTION. or is there any other format...!?..or did i made any mistake in the format?

Pls let me know...

Thanx,
Sam.
0
 
LVL 92

Expert Comment

by:objects
ID: 10831063
you shouldn't be printing the include statement you should just use:

<jsp:include page=\"page2.jsp\" flush=\"true\">

Not sure how thats going to help with your problem though.
0
 
LVL 13

Accepted Solution

by:
copyPasteGhost earned 300 total points
ID: 10835359
why don't you do this.

<!-- MAIN.jsp -->

<form action="myjsp.jsp" method="post">
  <jsp:include page="page1.jsp" />
  <jsp:include page="page2.jsp" />
  <jsp:include page="page3.jsp" />
  <jsp:include page="page4.jsp" />
  <input type="submit" value="click here" />
</form>

on your page1 you have something like this...

<!-- Page1.jsp -->

<table>
  <tr>
    <td>first name</td>
    </td> <input type="text" name="fName" /> </td>
  </tr>
</table>

you get the idea..
that way you can have many pages using the same form.
Hope that's what you wanted.
Ghost
0
 

Author Comment

by:jaggybala1
ID: 10836786

Great help Ghost!....thanx a lot...

but my submit button gets deactivted when my input fields exceeds certain number of characters!!!...I have totally 80 fields inside the form..it works fine when i give less than that certain number of characters...

can u identify what might have went wrong?
0
 
LVL 13

Expert Comment

by:copyPasteGhost
ID: 10837012
I've never heard of that happening..
but that seems like a big number of text fields..
I think you should break it down like maybe put 20 on each page...when you click sumbit you can save the 20 already entered values into a javabean.
and then continue this way until you get all your data entered..
that's what I would do..
 that would mean that your javabean would have 80 gets and 80 sets and 80 private variables... sounds like alot but you can get it done that way.

If you need anything else let me know,
Ghost
0
 

Author Comment

by:jaggybala1
ID: 10842946
Thanx... The problem was that i have used 'GET' method instead of 'POST' method..

anyhow,...thanx for all experts suggestions which is helping me a lot..

- Sam.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
In this blog we highlight approaches to managed security as a service.  We also look into ConnectWise’s value in aiding MSPs’ security management and indicate why critical alerting is a necessary integration.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question