Welcome, Guest
Username: Password: Remember me

TOPIC: Form fill date_till after date_from is filled

Form fill date_till after date_from is filled 30 Jun 2012 16:15 #2721

  • molenwal1
  • molenwal1's Avatar
  • Offline
  • Senior Member
  • Posts: 63
  • Thank you received: 17
  • Karma: 3
I have a form with two date fields: dt_from and dt_till.
I want to create an OnChange event. After typing in a value in the dt_from field i want to fill the dt_till field with the dt_from + 7 days.

Who can help me with that?
Molenwal1 Webdesign
www.molenwal1.nl
The administrator has disabled public write access.

Re: Form fill date_till after date_from is filled 02 Jul 2012 09:00 #2727

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Anywhere in JDom, you can use the 'selectors' parameter.
JDom::_('html.form.input.text', array(
	...
	'selectors' => array(
		'onChange' => htmlspecialchars("My javascript code"),
		'rel' => 'foo',
		...
	)
));

Not tested, maybe some syntax error, but the idea is that.
'selectors' parameter is unherited for all the classes under 'html.xxx'
JDom is open and unlimited.
Coding is now a piece of cake
Last Edit: 02 Jul 2012 09:00 by admin.
The administrator has disabled public write access.
Time to create page: 0.072 seconds

Get Started