JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 21st, 2004, 10:10 AM
tonycava tonycava is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 6 tonycava User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Difficult form submit problem tell me is it impossible

I have a difficult problem with no idea how to solve it at the moment I
The problem is as follows at the moment I have the following java/HTML code



while(rs.next())

{

%> <form name="setlimits" method=POST action="controlservlet">

<tr>

<input type="text" name="new_limit" size=10>



<tr>

<tr>

<td>

<input type="text" name="new_limit" size=10>

<td>

<tr>

<tr>

<input type="submit" value="Amend Limit">

</form>

<tr>

<%

}



When I press submit the controlservlet is called and two parameters passed to it new_limit and a corresponding index.



index = request.getParameter(“index”);

new_limit = request.getParmeter(“new_limit”);



This allows me to update a table row with the new_limit in the database where index = index.



What I have now been asked to do is to also supply a submit all button, when this button is pressed I should pass to the controlservlet all the new limits with all the corresponding indexs.



Is this possible, As I see it this will be a client side operation as all the data has to be entered first, what I need is to run a javascript function which will extract all the indexes and limits and pass them into a javascript object, which I can then translate into a java object.

Is this possible


Thanks Tony


Reply With Quote
  #2  
Old July 22nd, 2004, 06:35 AM
tonycava tonycava is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 6 tonycava User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
There has to be an easy solution, but cant find it on the web

Maybe my first explanation was too complex


<form name="limits" method=POST action="global">
<input
type="text" name="new_limit" size=10>

<input type="hidden" name="borg_num" value="<%= rs.getString("borg_num") %>">

<input type="submit" value="Amend Limit">

when run it will look like this if I have 4 limits to set

limits

[] (amend limit)

[] (amend limit)

[] (amend limit)

[] (amend limit)

I enter data into one of the boxes say 10 and press the button (ammend limit) then the data entered 10 plus

the hidden identifier for that limit borg_num will be fired of to the control servlet.

I have been asked to add another button (ammend all)

limits

[] (amend limit)

[] (amend limit)

[] (amend limit)

[] (amend limit)

(amend all)

what this button will do is if I enter data in all four boxes on pressing submit I will need to get all 4 limits with all four matching borg_num identifiers and pass to the controlservlet.



I have written the amend all button



<input type="button" value="Amend All" onclick="submitAll()" />

<
form name="allForm" method=POST action="global">

<input type="hidden" name="cmd" value="temp_limits">

</form>



and have started the javascript function

<script>
function submitAll()

{
document.getElementById("allForm").submit();
}
</script>



I have no idea how to pick up new_limit and borg_num from the form and store them in a document.



Thanks for any help.

Tony



Reply With Quote
  #3  
Old July 22nd, 2004, 08:27 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
In your servelet, I'd think you'd just create a request object and access the request variables using that object. My java's a little rusty, so I can't give specifics. Basically, though, it looks like you're getting hung up on client-side stuff when all you really need to do is post to the servelet and then add code to the servelet that extracts values submitted through the form.
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Difficult form submit problem tell me is it impossible


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT