tyler_w
10-06-2004, 06:50 PM
OK, Im having a really frustrating lack of action..
Here's what I've got.
A form with a whole bunch of search options that submits via POST, back to the same form. It's got a 'Submit' button.
The ASP code picks up the form, generates an SQL statement, and opens recordset.
What I want to do, is divide up the records returned by a 'results/page' input and 'next'/'previous' links.
Everything *would* be working fine, except for one tiny problem... It doesn't work.
Here's the (relevant) code, this is done is ASP, btw.
'generate next url
nextURL = "listBook.asp?op=search&start=" + cstr(RecordStart + RequestsPerPage)
'write link to page
response.write "<a href=vbscript:void onClick=Redir('" + nextURL + "')> Next " + cstr(TotalLeft) + "</a>"
And in VBScript, the Redir sub
Sub Redir(href)
Document.listBook.action = href
Document.listBook.submit
' alert Document.listBook.action
End Sub
The alert, when uncommented, works fine and shows exactly what I want it to... BUT, the form doesn't submit. It sits there. If I try and press 'Submit' button further up on the form, it uses the action i gave it. EVERYTHING WORKS EXCEPT THE FORM SUBMITTING via the Redir Sub. very frustrating.
Here's what I've got.
A form with a whole bunch of search options that submits via POST, back to the same form. It's got a 'Submit' button.
The ASP code picks up the form, generates an SQL statement, and opens recordset.
What I want to do, is divide up the records returned by a 'results/page' input and 'next'/'previous' links.
Everything *would* be working fine, except for one tiny problem... It doesn't work.
Here's the (relevant) code, this is done is ASP, btw.
'generate next url
nextURL = "listBook.asp?op=search&start=" + cstr(RecordStart + RequestsPerPage)
'write link to page
response.write "<a href=vbscript:void onClick=Redir('" + nextURL + "')> Next " + cstr(TotalLeft) + "</a>"
And in VBScript, the Redir sub
Sub Redir(href)
Document.listBook.action = href
Document.listBook.submit
' alert Document.listBook.action
End Sub
The alert, when uncommented, works fine and shows exactly what I want it to... BUT, the form doesn't submit. It sits there. If I try and press 'Submit' button further up on the form, it uses the action i gave it. EVERYTHING WORKS EXCEPT THE FORM SUBMITTING via the Redir Sub. very frustrating.