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.

date format problem

Featured Replies

I have a file that has the date formatted dd/mm/yyyy, but I want the user to be able to enter the date mm/dd/yyyy from the web form. ( I tried changing the database to use system formats but it gave an 500 error when I tried submitting data from the web form this way). Got any ideas how to do this ?

Hi, date formats on the web can be a pain. I'd use two fields:

The input field which would be a text field and would have a JavaScript validation to make sure that it's really input mm,dd,yyyy and then I'd do a calculation text-to-date field in the database to swop it around, maybe like this:

TextToDate(Middle(thedate_input,4,2)

&"/"

&Left(thedate_input,2)

&"/"

&Right(thedate_input,4))

on second thoughts, just do the same thing within the HTML page with JavaScript into a hidden field and use that for input!

regards, jeff

  • Author

Thanks for the help Jeff! laugh.gif

You can do this with Javascript on the page before the Form is Submitted. For example:


<html><head>

<script>

function moddate()

   {

   formdate = document.myform.mydate.value.split("/");

   document.myform.mydate.value = formdate[1] + "/" + formdate[0] + "/" + formdate[2];

   return true;

   }

</script>

</head>

<body><form name="myform" action="FMPro" method="POST" onsubmit="moddate();">

<input type="hidden" name="-db" value="mydb.fp5">

<input type="hidden" name="-format" value="mypage.html">

Enter Date (mm/dd/yyyy): <input type="text" name="mydate" value="">

<input type="submit" name="-new" value="Submit Form">

</form></body></html>

Hope this helps.

Garry

Hi, army! I've been away from the FM world for months so I'm a little rusty, but I think I remember something about some formats being related to the layout being used. Maybe you can use a different layout for web input? I have not checked this at all, but I just thought I'd mention it if you haven't tried it yet.

Good luck!

--ST

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.