This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes submit button only works once? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "submit button only works once?" Watch "submit button only works once?" New topic
Author

submit button only works once?

rich werth
Ranch Hand

Joined: Sep 21, 2001
Posts: 57
Hello again
I am having some trouble calling a servlet more than once. I am posting here first bcuz it doesn't get to the servlet more than once(doesn't call post method)
What I am doing is grabbing a list it has x number of items in it and I am displaying them in a browser page 5 at a time. I am using a submit button in a form to do this
<form name="form1" method="post" action="glControl">
<input type="submit" name="button" value="Next">

</form>
This only works once, then it doesn't call the servlet again?? Why doesn't it?
I get to go to page 2 and see items 6-10 and that's it. On other presses it just refreshes the screen.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Have you checked at the server side to make sure it isn't hitting the servlet? The 'page refersh' you are seeing may be the servlet sending the same data back each time.
The problem is the almighty page caching issue, but I think that's less likely. To eliminate the caching problem, add this to your servlet

Dave
rich werth
Ranch Hand

Joined: Sep 21, 2001
Posts: 57
Hi Thanks for the reply
It wasn't going to the servlet bcuz my stupid cache setting in netscape said not to check for pages.
I chaned it and it works fine now
 
 
subject: submit button only works once?
 
Similar Threads
multiple form submits works in ie not in netscape?
Losing data from submit using the enter key
Need a little more explanation on how to use urlmapper
Why doesn't exercise 8-1 from Murach's Java Servlets work for me on IE7?
multiple forms in JSP