By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,364 Members | 1,567 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,364 IT Pros & Developers. It's quick & easy.

Re-load Page Programmatically from VBScript

P: 63
I set up a page which allows the user to add data to a table. I would like to then re-load the page to display all of the data in a list including the data the user entered. I currently have fields which are able to re-load the page by using the OnChange event and firing the following java script:

function OnChangeField()
{
document.frmKPIActMaintReg_01.submit();
}

Is there a way to programmatically accomplish this from within vbscript so that after the user enters the data and I insert it in the table, I somehow from within vbScript fire the submit() event
Nov 19 '08 #1
Share this Question
Share on Google+
6 Replies


jhardman
Expert 2.5K+
P: 3,405
You can't actually fire a submit from asp, the closest thing is put a onload=submit in using asp, or redirect including form data in a querystring. Do you need help doing either of those things?

Jared
Nov 20 '08 #2

P: 63
You can't actually fire a submit from asp, the closest thing is put a onload=submit in using asp, or redirect including form data in a querystring. Do you need help doing either of those things?

Jared
Yes. Could you post a sample code.

Thanks,
Ralph
Nov 21 '08 #3

jhardman
Expert 2.5K+
P: 3,405
Yes. Could you post a sample code.

Thanks,
Ralph
Ralph,

Sure, let me get a better idea of what you're doing. You enter one row of data, after each input is added a submit() is called form javascript which posts this data to a formhandler which updates the database. Am I right so far?

Then you want the form handler to re-display all of the data that has been entered? Is this right?

Jared
Nov 21 '08 #4

P: 63
Yes that's it. In vbscript I do the following:
<%
Insert new record into table ....

Select * from table for all records in same time period and location and display on screen ....

I think before I do the select, I have to execute some type of Javascript which clears the screen.
Nov 25 '08 #5

jhardman
Expert 2.5K+
P: 3,405
@rmurgia
I don't think anything related to clearing the screen is necessary, everyt ime you submit the form, the page will need to be reloaded. I would just do this all on one page, no need to redirect or clear the screen. At the top of the page, check to see if the user has added new data. If he has, go ahead and save that to the db. Then query the db and build the table of data that needs to be displayed. As long as you save any recently added data first, it will be included in the table that is generated, probably at the bottom (depending on what kind of sorting you use). Finally, add the form that allows the user to enter new data. I think this accomplishes everything you are looking for.

Jared
Nov 26 '08 #6

P: 63
Jared,

I re-wrote the program as per your suggestion and everything is now working.

Thanks for the help,
Ralph
Nov 28 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.