Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Radio buttons to choose a Date in DD/MM/YYYY format in addrecord.php

Featured Replies

My question may be as simple as how do I enter a date in DD/MM/YYYY format using a radio button?  (If you can answer that, ignore the rest).

I have a simple form for online Timesheets that we have been using for years (thousands have been entered without almost no work on my part since I set it up).  Now we want to change the date format from MM/DD/YYYY to DD/YY/YYYY.  Everything works except where I auto-enter the "Period Ending" Date.

An assistant updates the global value for the "Period Ending" Date  in FileMaker every two weeks- this date needs to be auto-entered in new Timesheets (but must be modifiable by workers).  Since addrecord.php is creating a new record I use a valuelist that finds that date [a related, global value] in a global table that consists of one record with various global values for the Timesheets table. 

<?php $fieldValue =   "test " .       $record->getField('Period Ending', 0) ; ?> <?php getInputChoices("radiobutton", $layout->getValueListTwoFields('Timesheet Period Ending Date', (isset($master_record)) ? $master_record->getRecordId() : $record->getRecordId()), $fieldValue, getFieldFormName('Period Ending', 0, $record, true, 'RADIOBUTTONS', 'text'), 'text', $submitDateOrder);?> is the ending date for the Current Pay Period.

this appears as 

2-Week Period Ending (MM/DD/YYYY):  [Entry field with 07/04/2015 autoentered]07/04/2015 is the ending date for the Current Pay Period.

And really works well (don't ask me about 'test ', it is ignored).  To change the date format I tried doing a calculation [Day ( timesheets Period Ending global ) & "/" & Month ( timesheets Period Ending global ) & "/" & Year ( timesheets Period Ending global )] to change the order but it submits it in the MM/DD/YYYY format (other date fields ARE dealt with properly!!!).

 <?php $fieldValue =   $record->getField('Period Ending', 0) ; ?> <?php getInputChoices("radiobutton", $layout->getValueListTwoFields('Timesheet Period Ending Date calc', (isset($master_record)) ? $master_record->getRecordId() : $record->getRecordId()), $fieldValue, getFieldFormName('Period Ending', 0, $record, true, 'RADIOBUTTONS', 'text'), 'text', $submitDateOrder);?> is the ending date for the Current Pay Period.
2-Week Period Ending (DD/MM/YYYY):  [Entry field with 04/07/2015 autoentered]04/07/2015 is the ending date for the Current Pay Period.

This is entered as April, while in the other date fields in the same form 04/07/2015 is entered as July.

I am doing this with Filemaker Server 11, using PHP/Apache on a mac mini client.

Edited by Dave Carmean
Entry field box with auto-entered date was not visible

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.