• Post Reply Bookmark Topic Watch Topic
  • New Topic

Trying to hide input from a select form

 
Rob Singley
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my first post to this forum....
I'm stuck trying to do something that I think should be relatively simple...
I have a page with a select box. When you make a selection from this box the data is populated in a search box. So you can type a query and then use the select box to append to the query. What I want to do is let make a selection but the text not show up in the search box but still get appended to the query.
When the onchange is executed I want to make that value append to Querytext and be hidden....

Here is the code that I am using:

<!-- ************* BASIC SEARCH FORM TEXT AREA ************* -->
<div class="border" style="padding: 5px; margin-left: 10px; margin-top: 10px; margin-right: 10px;">
<table cellpadding="0" cellspacing="0">
<tr>
<td class="label" style="width: 195px; padding-left: 10px;">Enter Query:</td>

<td class="formw">
<textarea class="text" style="width: 280px; height: 20px;" name="QueryText" id="QueryText"><jsp:getProperty name="objAdvancedQuery" property="htmlEscapedQueryText" /></textarea>
</td>


<!-- The search button, clicking this will submit the form -->
<td class="formw" style="padding-top: 5px;"><input type="image" class="searchImage" src="../../common/img/search.gif" alt="Search" title="Search" /></td>


<%


if (g_strQueryParser.equalsIgnoreCase("Simple")) {
%>
<td class="formw">
<table cellspacing="0" cellpadding="0" solid #000;">
<tr>
<td colspan="4" style="padding-left: 2px; font-size: 8pt; font-weight: bold;">Entity Search:</td>
</tr>
<tr>
<td colspan="4" class="formwVQLHelper">
<select class="select" name="vqlOperator" id="vqlOperator"
onchange="vqlOperatorHelper(this[this.selectedIndex].value);" style="width: 190px;">
<option value="" selected="selected">-- Choose an Entity --</option>
<option value="<IN>CANCER">Cancer</option>
<option value="<IN>COMPANY">Company</option>
<option value="<IN>INTERNET_ADDRESS">Internet Address</option>
<option value="<IN>PERSON">Person</option>
<option value="<IN>PLACE">Place</option>
<option value="<IN>RESEARCH">Research</option>
<option value="<IN>VIRUS">Virus</option>
</select>
</td>
</tr>

</tr>
</table>


</td>
<%
}
%>
</tr>
</table>
</div>
 
Neeraj Vij
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Don't fetch data into the search box, instead fetch that value in a hidden field. and when u receive the form values in next page using request object, concatenate the query submitted in search box and the hidden form field.

Hope this will solve the problem.

Regards,
Neeraj.
 
Rob Singley
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried something like that(I may have been coding it wrong) . I had:

<input type=hidden name="selquery" value="" />

I could never get the select value to populate the hidden field. It always populated the textarea....
 
Neeraj Vij
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

need to have a look at the code you have written..

regards,
Neeraj.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!