Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

request.getOptionValueCount() problem

 
Gary Damschen
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I understand it, request.getOptionValueCount(paramName) can be used to determine whether or not a particular name-value pair has been passed to a jsp page. I am having a problem with the following piece of code that seems to work everywhere but on one particular page:
if (request.getOptionValueCount("amount") > 0)
{
// do something useful with request.amount
}
When I access the page I get the following error:
A problem occurred while processing this page. The error message is:
Javascript Error: ReferenceError: amount is not defined
lib/payment/cc_payment_info.js(Line 112)
Line 112 is the request.getOptionValue() line. I expected the server to skip the amount code section if there was no amount parameter passed into the page or amount= was passed in. Any suggestions re:what is causing the problem or how to work around it?
 
Manjunath Reddy
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i couldnt find the above method....but whats wrong with request.getParameter("Amount")?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18094
48
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... Which will return null if the parameter value was not passed in from the client.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic