Joined: Jul 21, 2006
(Sorry for posting the same content under a different subject.)
Dear Bear Bibeault, Thanks for your explanation regarding "sending variables along with html content".Now I�ve got a clear idea of what a browser understands and what it doesn�t . But now I�ve another problem� When the user clicks on the checkout button for the first time , if purchase amount is greater than balance then the alert message �Insufficient Balance� is displayed. Seeing this alert message the user modifies his/her purchase requests so that purchase amount is less than balance. To modify a (purchase/sell)request , Modify.jsp and SaveChanges.java servlet are used. SaveChanges.java makes the required changes to the Requests object(it�s a Model, shoppingcart kind of object) and forwards the httprequest to DisReq.jsp
When the user clicks on checkout button(for the 2nd time) after modifying purchase requests, the browser uses the old values of script variables puramt and balamt (used during first checkout) to check whether purchase amount< balance
<%--DisReq.jsp displays the Buy/Sell stocks requests so far placed by the user--%> <%--Allows the user to remove or modify a desired request, place more requests and checkout--%>
You might also investigate Ajax which will let you post back to the server without a full-page reload. But bear in mind that the user can undo everything by simply hitting the refresh button.
Bottom line: all important data must be presisted to the server and sent to the browser as necessary.