Solved

jsp page with 2 frames (and 'submit' button in both frames)

Posted on 2003-11-04
5
1,201 Views
Last Modified: 2007-12-19
Hello,

New to jsp, so please bear with me. I have a .jsp which shows 100 rows of text. Each row of text has a checkbox (for the user to select) on the left. After the user has selected a particular row, he/she has to scroll all the way to the bottom (after the 100th row) to hit the 'Submit' button. I would like to encapsulate the 'submit' button inside a top frame (as well as having the Submit button at the bottom of the page), so no matter which row the user has selected, the submit button is always there at the top. Any ideas how the jsp page & it's frame should be constructed?

Many thanks
-A
0
Comment
Question by:alefebvre
5 Comments
 
LVL 51

Accepted Solution

by:
Ryan Chong earned 43 total points
ID: 9683871
In your top frame, let say your, you can try this:

<input type="button" name="Button" value="Button" onclick="javascript:parent.mainFrame.form1.submit();">

where your frames structure will be like:

<frameset rows="169,*" frameborder="NO" border="2" framespacing="2" cols="*">
  <frame name="topFrame" scrolling="NO" noresize src="top.jsp" >
  <frame name="mainFrame" src="down.jsp" frameborder="NO">
</frameset>

Hope this helps
0
 
LVL 3

Assisted Solution

by:applekanna
applekanna earned 41 total points
ID: 9683930
if you are prepard to have a button for each row then you can write a small script to submit the form, this allows the user to make sure he has selected the right row to submit.


<form name = someform method = post action = ../servlet/go>
<input type = hidden name = "thValue" value = "">
</form>

<table>
<tr>
<td> <input type  = checkbox  name = "somename"  value = "100"> 100th row </td>
</td> <input type = button onclick:javascript:submitValue(100)> </td> </tr>
<tr>
<td> <input type  = checkbox  name = "somename"  value = "101"> 101th row </td>
</td> <input type = button onclick:javascript:submitValue(101)> </td> </tr>
</table>

<script>
function submitValue(value)
{
document.someform.thValue = value;
document.form.submit;
}
</script>

0
 
LVL 6

Assisted Solution

by:jarasa
jarasa earned 41 total points
ID: 9777624
Hi alefebvre.

I believe both of the above answer are perfect, but I will make you consider that you use a <DIV> with scrollbars wich will prevent the page being too large and the you can place your submit button rigt below the </DIV> so it will be alway visible and ready to be pushed, is just a matter of style.

If you need help with it just ask.

Have Fun
Javier
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
There's a lot of hype surrounding blockchain technology. Here's how it works and some of the novel ways it' s now being used - including for data protection.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

831 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