Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in setting the value in JSP

 
Gaurav Chikara
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All
Problem seems to be trivial but I still am not able to figure out the cause for it

I have the following snippet of code from where I sent the quoteId and actionItem from select drop down list's onchange event to javascript function

<select name="actionItem" style="width:120px" onchange="submitForm(<%=bean.getQuoteId()%>,this.options[this.selectedIndex].value)">
<option value="" ><%=QGConstants.QG_STRING_SELECT_VALUE%></option>
<option value="<%=QGConstants.RETRIEVE_QUOTE_VIEW_ACTION%>">View</option>
<option value="<%=QGConstants.RETRIEVE_QUOTE_DELETE_ACTION%>">Delete</option>
<option value="<%=QGConstants.RETRIEVE_QUOTE_UNARCHIVE_ACTION%>">Un-archive</option>
</:select>


My javascript function submitForm has the following snippet
function submitForm(quoteNumber,actionValue){
alert(quoteNumber);
document.forms["RETRIEVE_QUOTE"].actionItem.value=actionValue;
document.forms["RETRIEVE_QUOTE"].quoteId.value=quoteNumber;
document.forms["RETRIEVE_QUOTE"].search.value = 'archivedQuoteSearch';
document.forms["RETRIEVE_QUOTE"].action = "RETRIEVE_QUOTES?searchTab=1"
alert(document.forms["RETRIEVE_QUOTE"].quoteNumber.value);
document.forms["RETRIEVE_QUOTE"].submit();
alert(document.forms["RETRIEVE_QUOTE"].quoteNumber.value);
}

I get the value as passed from JSP as it is in this function but
still value is not set into the hidden variables quoteId and actionItem
and my subsequent alert prints blank.
Am I doing something wrong here?
Thanks in advance
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use UBB code tags when posting code in order to preserve its formatting, and please take the time to post question in the appropriate forum.

Moved to the HTML/Javascript forum.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!