Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to pass these values from one jsp to another jsp  RSS feed

 
Sabarish Jaganathan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi to all ,
i need to pass the calculated showValue and quan inside the function from jsp to another jsp on a submit button click
this is should be done at run time <script type="text/javascript">
function calculate()
{
if(myform.quan.value == "" || myform.quan.value == null )
{

alert("please enter quantity in number only and it must not be empty ");
}
else
{
var price = parseInt(document.getElementById("price").value);
var quan = parseInt(document.getElementById("quan").value);
var showValue = parseInt(document.getElementById("showValue").value);
showValue.value = price * quan;
showValue=showValue.toString();
//window.location.replace("showValue="+showValue+"quan="+quan);
//window.location.replace("showValue="+showValue+"quan="+quan);
}
}

</script>
i have been pasted only the function i need to post other part coding
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rather than a lot of script, why aren't you just using a form?
 
Sabarish Jaganathan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using form only its the part of the coding ???
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The why aren't you simply submitting the form? Why all the script?
 
Sabarish Jaganathan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank for reply i could be able to pass the values to another jsp
 
Sabarish Jaganathan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi.,
i am doing online shopping system using jsp and java in that when user add the products to their cart for example he buy an product for Rs 5000 again for second he added another product to his cart for example he buys a products Rs 2000 i need to calculate total amount payable is Rs 7000 and display it jsp page how to do it ? shall i use session management in this how to do that i can able to pass only one value at a time and i could not able to add them to the previous one
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!