• 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: Automatic date filled in depending on a textbox

Automatic date filled in depending on a textbox 12 years 7 months ago #14882

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

I am trying to fill a date field determined by another date field and a text box. So there is a commencement date (the actual calendar picker field), a textbox for number of weeks and a completion date. I want the completion date to be automatically created when the commencement date is filled in and the completion date would be x weeks after the commencement date. Any Ideas?

Also what is the code to hide form fields on load?

Thanks,

Jamie.
The administrator has disabled public write access.

Re: Automatic date filled in depending on a textbox 12 years 7 months ago #14968

Would also be interested in getting code for current date to automatically fill a Textbox.

Regards.
Last Edit: 12 years 7 months ago by thevisionboard.
The administrator has disabled public write access.

Re: Automatic date filled in depending on a textbox 12 years 7 months ago #14969

This may answer "thevisionboard"s question but probably won't help the original poster. Sorry!

To fill in a date I created a text box named Date and put the following code into Default value:
//<code>
$today = date("F j, Y");
return $today;
//</code>

I didn't write this code, but found it somewhere on the forum a while ago. I only need "current date" on my forms so this works for me.
Kathy
The administrator has disabled public write access.
The following user(s) said Thank You: thevisionboard

Re: Automatic date filled in depending on a textbox 12 years 7 months ago #14985

  • mwoomer
  • mwoomer's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Have you had any luck with this? When I put this code in as my "default value" then the code itsself is simply displayed as the default value.
The administrator has disabled public write access.

Re: Automatic date filled in depending on a textbox 12 years 7 months ago #14991

Hi,
I use the code (posted above) on a number of forms (all done with v36). Here's a link to one that does display the date
nemgtr.org/index.php?option=com_content&...le&id=240&Itemid=270
I have access to v42 on another system so I think I'll try it there also.
I'm not a programmer so if it doesn't work, not sure what I'll do. The code was in an old post on the forum and when I find something interesting, I snag it and put it in a word doc to use later.

I'll post again after trying on the latest version.
Kathy
The administrator has disabled public write access.

Re: Automatic date filled in depending on a textbox 12 years 7 months ago #14996

Hello again,
I tried the code on both v41 and v42 and they work. So if you'd like a copy of the code in a form, send an email to This e-mail address is being protected from spambots. You need JavaScript enabled to view it and I'll send along a backup of the form so you can restore it and see what happens.
Regards,
Kathy
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!