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

Looping problem

Status
Not open for further replies.

fergman

Technical User
Oct 19, 2000
91
US
How can I get around this: I have a page that runs through a set of subroutines, the last one being a checkbox. I haev a onChange javascript action to report the data, but then I want to start over with the form(the data has been written to the DB). When I just call the main() sub again everything goes nuts. Here is the main():
sub main()
classNumber = classNumber + 1
call getDepartment

if depTrue = 1 then
call getCourse
end if

if couTrue = 1 then
call getSection
end if

if secTrue = 1 then
call getRecommended
end if

if recTrue = 1 then
formState = 1
end if

call writeDB

After writeDB runs, I want to start completly over with the form. but everytime I call main agian the form freaks out.
I think a response.redirect might work, but wouldn't I then lose the database transaction?
 
What U're trying to do is re-write the report (looping thru your table in your database) , isn't it ???
Perhaps U could use window.location syntax though response.redirect in your javascript function.
So when user makes any changes in your checkbox, javascript call function
Code:
rewrite()
.
and in your script U put

Code:
window.location = '[URL unfurl="true"]http://your_server/your_Dir/your_page.asp?your_query_string';[/URL]


along in your_query_string, U put a flag which triggers your_page.asp to run your subroutines Main()

Hope it helps. ;-)

Regard,
*JJ26* :eek:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top