• 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: Populate a hidden field based off user input

Populate a hidden field based off user input 13 years 4 months ago #12319

I am trying to find a way to have a hidden field be populated with data based on user entered data.

For example, I would like to know the Time Zone of the customer who filled out the form without having to ask them to select it from a drop down. If I am already asking for a phone number (area code) or a zip code, can I use this data to calculate their time zone?

I have been able to find zip code/time zone and area code/time zone tables online, so I am hoping if I were to get that data into a Joomla table (not sure how to do that) or if it were in some XML document on the server or something, that I could use RSForm to read zip code or area code and populate this hidden field with time zone.

Hope that makes sense.

Thanks
The administrator has disabled public write access.

Re:Populate a hidden field based off user input 13 years 4 months ago #12370

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Hello,

There is no need to calculate anything. You can simply create a small javascript that will return the time stamp of your user's computer. In the CSS/Javascript tab (Javascript area), just use something like this:
<script type="text/javascript">
function utime()
{
today = new Date();
document.getElmentById('name_of_hidden_field').value = today;
}
</script>

In the Additional attributes of the submit button just add something like this:
onclick="utime();"
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
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!