Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SEARCH QUESTION

Status
Not open for further replies.

Lambro

Programmer
Aug 22, 2001
258
US
I have a program I wrote in ASP for my Symbol scanner. It has 4 fields, Location, Item, Pack Quantity and Quantity.

When I scan the first field location, I would like for it to search the location table for any items that match and display those items on the screen.

I can do that by submitting the form after the location scan. Here's the catch, I would like after the form is submitted to keep the location I just scanned in the text field. Instead it clears the text field and I have to re enter it in.

Once it keeps the location, it should focus on the next field which would be the item field.

Thanks
 
So the form page is submitting to itself? This should help:

Code:
<%
If Request.Form(&quot;loc&quot;) <> &quot;&quot; Then
  'process form input
End If
%>

<form action=&quot;page.asp&quot; method=&quot;post&quot;>
<input type=&quot;text&quot; name=&quot;loc&quot; value=&quot;<%=Request.Form(&quot;loc&quot;)%>&quot;>
<input type=&quot;submit&quot;>
</form>
--James
 
You should be able to do this when the page reloads:

<INPUT TYPE=&quot;text&quot; id=&quot;mytextfield&quot; value=&quot;<%Request.Form(&quot;mytextfield&quot;)%>&quot;>

Because on the form submission, the value for the 'mytextfield' field is submitted, you can get at it from the Request.Form collection.

SheRa M&M's are better than money because you can eat them. ;)
 
Oops... forgot the =. Should be...

<INPUT TYPE=&quot;text&quot; id=&quot;mytextfield&quot; value=&quot;<%Request.Form(&quot;mytextfield&quot;)%>&quot;>

And JamesLean is absolutely right that you should likely check for empty strings too. :) I'm just too lazy to write that. :)

SheRa M&M's are better than money because you can eat them. ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top