• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: How can I add a delay to a Javascript function?

How can I add a delay to a Javascript function? 6 years 2 months ago #38783

Hi everybody,

I have a form with a regular button (not a submit button!) which shows additional fields when it is clicked. To achieve this I have added this code into the Javascript field of the form:
<script>
function showFields()
{
document.getElementById('hidden_elements').style.display="inherit";
}
</script>

and I have added this code into the additional attributes of the button:
onclick="showFields()"; "validate()";

Also I have edited the form layout and put another div there:

<div id="hidden_elements" style="display:none"> ... </div>

This function is working properly without any issue. Now I need something in addition. Currently when the button is clicked the hidden fields show immediately. I need a delay of about 3-5 seconds until the fields are shown. During this delay it would be great if a message can be shown. Something like "Please wait a second while we are validating your entries.".

How can this be done?

Thanks for any advice,
Uwe
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!