Fire event to load page after field updated

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

    Fire event to load page after field updated

    I have set up an ASP web page which connects to an Access database using VBA. After the user clicks submit, the Access database is updated. I need to be able to update the page before the user clicks submit. When the user updates the product group field, the dropdown list on the product group detail field must be updated to reflect the new product group. I don’t believe I can set up an event to fire after a field is updated with VBA. Is there an after_update event which fires and can it be used with Javascript to submit the form behind the scene? If this is possible, I will use the VBA to re-load the dropdown and reload the page each time the user changes the product group field. Hopefully this will be transparent to the user. Does anyone know if this is possible?
  • RamananKalirajan
    Contributor
    • Mar 2008
    • 608

    #2
    Hi, I dont have any Knowledge on ASP. But the I can aswer the question you asked. You want to know wether form submit can be done by any other event not by onSubmit. You can do that but if you do so the page will move to the next action url. The only answer for ur question, after changing a drod down u want to hit that to the database and load some other drop down in the same page can be done through the Ajax. But submitting the form through other events will surely navigate the page. It will not be the solution for ur peoblem. Ajax may be a solution as for as I know. Any doubts post back it.


    Regards
    Ramanan Kalirajan

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Yes, use Ajax to avoid a page reload. Use the onchange event to call a function to make an Ajax request. The response from the server can be parsed for use in populating the drop-down at the client-side. See this simple example.

      Comment

      • rmurgia
        New Member
        • May 2008
        • 63

        #4
        Originally posted by RamananKaliraja n
        Hi, I dont have any Knowledge on ASP. But the I can aswer the question you asked. You want to know wether form submit can be done by any other event not by onSubmit. You can do that but if you do so the page will move to the next action url. The only answer for ur question, after changing a drod down u want to hit that to the database and load some other drop down in the same page can be done through the Ajax. But submitting the form through other events will surely navigate the page. It will not be the solution for ur peoblem. Ajax may be a solution as for as I know. Any doubts post back it.


        Regards
        Ramanan Kalirajan
        Thank you for the reply. I was able to set up an onChange event for the field in question. Is it possible from within Javascript to simulate the submit command?

        Regards

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Yes it is (with the form submit() method), but then that would submit the page. Did you not want to avoid that?

          Comment

          • RamananKalirajan
            Contributor
            • Mar 2008
            • 608

            #6
            Originally posted by rmurgia
            Thank you for the reply. I was able to set up an onChange event for the field in question. Is it possible from within Javascript to simulate the submit command?

            Regards
            [HTML]function next()
            {
            var x=document.getE lementById('myf orm'); // Id of the Form
            x.action="NewDe mo.html";
            x.submit();
            }[/HTML]

            This is the way u can do. i.e. submitting a form using javascript.

            Regards
            Ramanan Kalirajan

            Comment

            Working...