• 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: Validation of calendar field using javascript

Validation of calendar field using javascript 13 years 6 months ago #11865

  • neil2
  • neil2's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Hi,

I am trying to find the correct javascript syntax for validating the return value for a calendar field when submit button is pressed.


This code works for a text field.

var x=document.getElementById("test");
document.writeln(x.value);

but we cannot access a calendar field in the same way - this code doesn't work.

var x=document.getElementById("date");
document.writeln(x.value);

Does anyone know what the javascript syntax is for handling a calendar field?

Thanks, Neil
The administrator has disabled public write access.

Re:Validation of calendar field using javascript 13 years 6 months ago #11895

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

This is most likely caused by the fact that you are not using the correct id. The text field that holds the calendar value is something like this : txtcalx, where x is actually a counter (0, 1, 2...etc).

Example:
document.getElementById('txtcal0').value

To determine the correct id it would be best to use an inspecting tool like Firebug or view the page source.
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.
The following user(s) said Thank You: Raduol
  • 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!