This topic is locked

Onclick Refresh

7/22/2010 9:55:56 AM
ASPRunnerPro General questions
J
Jay123 author

Hi!
I would like to ask for a script for onclick (dropdown box) refresh. I've got a scipt before for onclick alert. However, I can't use that since it stops the execution of populating the other.
What I would like to happen is, when an item is selected from a dropdown box, the user will not be able to do anything until all fields are populated or updated.
Thanks,

Jay

J
Jane 7/23/2010

Jay,
use JavaScript API to add onclick (or onchange) event for the dropdown control:

http://xlinesoft.com/asprunnerpro/docs/javascript_api.htm
I'm not sure that I fully understand what does 'not be able to do anything' mean. Could you clarify it?

J
Jay123 author 7/23/2010

Hi Jane,
Thanks for the reply.
What I meant by "not be able to do anything" was, I have lookup fields (ex. fields 2 to 20) and these fields get populated/updated based from the option selected from a dropdown field (ex. field 1).
Some users are not patient enough to have fields 2 to 20 populated/updated and they click on the "Send" button right away. What the "Send" button does is, it emails the values of fields 2 to 20 to the user. So, if they click the "Send" button before those fields are populated/updated, the email that they get is incomplete.
I am hoping that the onclick refresh will not allow them to click the "Send" button until fields 2 to 20 are populated/updated. I am looking at codes that I can use for dropdown field 1. I appreciate if you can give me one.
Thanks,

Jay

A
ann 7/23/2010

Jay,
generally you can do it in the following way. You can add onchange event for the first dropdown and set up save button as disabled. Then enable it after some time using setTimeout() javascript function in the same event.

More information:

http://www.w3schools.com/js/js_timing.asp

Unfortunately it's difficult to calculate the time when the last dropdown was filled.