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

Submitting a form containing only 2 hidden values (NO SUBMIT BUTTON!) 1

Status
Not open for further replies.

vix

Programmer
Mar 28, 2002
11
0
0
GB
Hi forum,
Here's the problem:

I need to create a loop in an ASP which updates the 'action' of a form and automatically submits it each time the loop runs.

So far, I've got:

<% @language=&quot;vbscript&quot;%>

<script language=&quot;javascript&quot; >
function submit(){
document.frmquery.submit;
}
</script>

....
.......
....


Do while not CompanyName.eof
SUPPLIERNAME=trim(CompanyName(0))

If not product.eof Then
QTY=qty
ProdID=(trim(product(0)))
Else
%>
<TD></TD>
<%
set product = nothing
End if
%>
<form name=&quot;frmquery&quot; method=&quot;GET&quot; action=&quot;../<%=SUPPLIERNAME%>/OnlineCheck.asp?ProductID=<%=ProdID%>&Quantity=<%=QTY%>&quot; OnBlur='javascript:submit();'>

</form>
<%
price=request.form(&quot;Price&quot;)
<TD><%=Response.write(price)%></TD>


Any help/suggestions would be very welcome
Vix
 
oops, forgot 'loop' when pasting to email
Vix
 
Hi

This may be a problem if you are trying to get a form to be submitted lots of times based on your recordset. The javascript you are using is a client side script, whereas the asp is server side.

What? Well all the asp script will do is write a load of forms in to a page with each one having the onBlur event attached to them, and send that to the browser. Then each form will need to be onBlurred in the page. Run the asp page and take a look at the html output you get.

The thing to do is to tell us what submitting these forms automatically will do, because it is this action which should be done as you loop through the recordset, not by writing a form which needs to be submitted by the user. The cahnces are you can avoid all this with some nice asp code. Derren
[Mediocre talent - spread really thin]
 
Hi derren,
Looked at the HTML source and I can see what you mean.

At the minute I've got 2 suppliers in my CompanyName recordset(this makes a very small recordset, I know, but more may be added in the future).

For each product, I want to loop through the suppliers and send off ProductID and Quantity value pairs to their appropriate active server pages (which in turn query the suppliers' databases over an HTTP connection .... but each supplier does this differently - hence their own asps).

I want to generate and display this whole page automatically from a hyperlink so I don't want any user intervention after that click.

Hope this fills in the gaps in my question...
Vix
 
So you are trying to get an up to date list of products from both of your suppliers by using their databases and asp? What are you going to do with this, display them or add the values to your database?

Your best bet for display purposes is to have a word with your suppliers and arrange to get a custom asp page made for your purposes using a more simple select* command ratherthan querying every product individually. Beware of the demands and possible overheads of doing this each time though, as your customers query your site which in turn queries another site for every page, and if their site is down, so is yours.

There are so many issues here, so post back your next questions. Derren
[Mediocre talent - spread really thin]
 
Yep, for each product (pre-selected list, < 30 in number) I want to display (in a new page) a row in a table which includes the query responses from all the suppliers. A real-time query response table.

The idea was that in the loop, after the form had sent the data to the supplier's 'OnlineCheck.asp' I would put the responses in a first-in-first-out buffer (possibly to a database later on, but not for our purposes now) and then add to that buffer until the loop had finished (i.e. there were no more suppliers to query), then dump the buffer into columns in the row for that product. Hope this is making sense. I may be trying the impossible.

Our customers don't access this information at all and the suppliers don't customise their active server pages.

Thankyou for all your help so far,
Vix
 
Your suppliers might want to consider customizing their ASP pages. While the traffic that you are generating will not be the noticeable, if there are 10 other people doing the same thing that you are doing, their server is going to become overloaded pretty soon.

Not to mention the speed increase that they and you would realize just by making a “select *” query available to you and other customers.
 
You could always offer to write the asp page yourself. Get them to send you the asp page which you are currently querying and you should be able to customise this very easily to give you the results that you are after. We can help you with this as well. Derren
[Mediocre talent - spread really thin]
 
Thankyou both for your help. I've been so chuffed to get people-in-the-know to talk to about this.
Unfortunately, this 'querying products' is just one part of a whole ordering, tracking, invoicing, etc.... ECommerce solution so, redesigning their asp isn't really an option ... but I'm flattered that you think I could write it myself - I only started to program in January.
Back to the drawing board with a clearer mind anyway, ta.
vix
 
Why don't you simply point the product to the actual page on your suppliers' sites? If you needed to brand it to suit, why not use a frameset, put your banners/logos etc in in and load the supplier page into it? If your frameset page is also an asp page you can pass a parameter to it to load a specific page into the mainframe - I can show you how to do that as well. Derren
[Mediocre talent - spread really thin]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top