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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I want to have cusotmers ordering parts on our site

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
How can I have a form keep updating without moving to the next page. In other words If I was doing this In Access I would have a List box and just keep adding their parts to a ever growing list. the list would requery every time to show the new part.
I have a Table thats dynamic on my .ASP page but how do I refresh it and stay on the same page after they click a Add this part button.

I would prefer to do it in VBScript Server side
<%@ Language=VBScript %>

 
Inventory.asp and update_inventory.asp -- just examples.

in inventory.asp at the very top of the page
-------------------

<%@language=vbscript%>
<%response.expires=0%>
--- Query the database ---
<%
dim oConn,strConn,oRS,strSQL
set oConn = server.createobject(&quot;ADODB.Connection&quot;)
strConn = &quot;whatever you prefer&quot;
oConn.open(strConn)
strSQL = &quot;Select some_field from some_table&quot;
set oRS = oConn.execute(strSQL)
%>
----------------------------------------------------
--- wherever your form is ---
----------------------------------------------------
<form name=&quot;invent&quot; action=&quot;update_inventory.asp&quot;>

--- Populate the listbox ---
<select>
<%
oRS.movefirst
do while not oRS.eof
%>
<option value='<%=oRS(&quot;some_field&quot;)%>'><%=oRS(&quot;some_field&quot;)%>
<%
oRS.movenext
loop
%>
</select>
<input type=&quot;text&quot; name=&quot;smth&quot;>
<input type=&quot;text&quot; name=&quot;smth1&quot;>
<input type=&quot;text&quot; name=&quot;smth2&quot;>
<input type=&quot;submit&quot;>
</form>

---------------------------------------------

in the update_inventory.asp at the very top of the page
---------------------------------------------
<%@language=vbscript%>
<%response.buffer=true%>

--- update or insert new data into the table, using response.form(&quot;smth&quot;)values ---

--- then redirect to the previous page ---

<%response.redirect &quot;inventory.asp&quot;%>

The update_inventory should not have any HTML in order not to be displayed and run behind the scene, or it could provide some validation or confirmation. In that case, it has to be displayed with some navigation elements to the inventory.asp

The inventory.asp will requery database every time it's called.

This is just a schema and implementation is up to you...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top