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

Fire event to load page after field updated

P: 63
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?
Aug 13 '08 #1
Share this Question
Share on Google+
5 Replies


RamananKalirajan
100+
P: 607
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
Aug 13 '08 #2

acoder
Expert Mod 15k+
P: 16,027
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.
Aug 13 '08 #3

P: 63
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
Aug 13 '08 #4

acoder
Expert Mod 15k+
P: 16,027
Yes it is (with the form submit() method), but then that would submit the page. Did you not want to avoid that?
Aug 14 '08 #5

RamananKalirajan
100+
P: 607
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.getElementById('myform'); // Id of the Form
x.action="NewDemo.html";
x.submit();
}[/HTML]

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

Regards
Ramanan Kalirajan
Aug 18 '08 #6

Post your reply

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