Re-load Page Programmatically from VBScript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rmurgia
    New Member
    • May 2008
    • 63

    Re-load Page Programmatically from VBScript

    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.frmKPI ActMaintReg_01. submit();
    }

    Is there a way to programmaticall y 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
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    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

    Comment

    • rmurgia
      New Member
      • May 2008
      • 63

      #3
      Originally posted by jhardman
      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

      Comment

      • jhardman
        Recognized Expert Specialist
        • Jan 2007
        • 3405

        #4
        Originally posted by rmurgia
        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

        Comment

        • rmurgia
          New Member
          • May 2008
          • 63

          #5
          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.

          Comment

          • jhardman
            Recognized Expert Specialist
            • Jan 2007
            • 3405

            #6
            Originally posted by rmurgia
            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.
            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

            Comment

            • rmurgia
              New Member
              • May 2008
              • 63

              #7
              Jared,

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

              Thanks for the help,
              Ralph

              Comment

              Working...