Skip 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.

CDML and form that creates a new record

Featured Replies

Quick question:

I know how to make a URL that will create a new record in my database.

I know how to use a form the create a new record in my database if the user is already logged into the database.

Can a form create a new record if the user IS NOT logged into the database? For example, the user goes to a standard web page NOT being part of a FM solution. On that page is a form. I would like the user to be able to fill out the form, hit submit, and have the information submitted as a new record to a database. I know how to use something like:

<form action="FMPro" method="post">

<input type="hidden" name="-DB" value="names.fp5">

<input type="hidden" name="-Format" value="results.htm">

<input type="text" size=12 name="Country" value="Australia">

<input type="submit" name="-New" value="New Record">

</form>

But this assumes the user is ALREADY in the database. If the user is NOT in the database, where would I enter the information such as URL information for the database? Maybe something like:

<form action="http://xxx.xxx.xxxx/FMPro" method="post">

Larry

Hello, Larry! I used to use the <FORM ACTION="http://.../FMPro" METHOD="post"> as my preferred way rather than just "FMPro" and it works great, even from web forms served from other servers. The -format page must be in the web server directory, though. Mostly I've done this for search engines, though, so no login's were required. I remember folks somewhere mentioning using the URL for logins but I'd never trust that, plus I heard Windows IE6 disabled its ability to do it, anyway. You can always just allow users with no passwords to make records, too, depending upon your situation and use.

--ST

  • Author

That is what I thought. Here is what I tried:

<FORM ACTION="http://xx.xxx.xxxx/FMPro" METHOD="POST" name="New">

<input class="text" type="text" name="Name">

<INPUT TYPE="hidden" NAME="-db" VALUE="Survey Contacts.fp5">

<INPUT TYPE="hidden" NAME="-lay" VALUE="Web">

<INPUT TYPE="hidden" NAME="-format" VALUE="thanks.html">

<INPUT TYPE="hidden" NAME="-error" VALUE="error.html">

<input type="submit" name="-New" value="Submit">

I would expect this to create a new record in my database, filling in the field called Name. Instead, upon Submit, it goes directly to the error page.

Been a while since I have done any CDML, so I am a bit rusty at this.

Larry

I'm rusty, too... Could it be generating the error because of not finding the -format page? If you are using a subdirectory, you'll have to specify that, too.

Try

...ACTION="http://xx.xxx.xxxx/mysubdirectory/FMPro"

if your -format is http://xx.xxx.xxxx/mysubdirectory/thanks.html

Hmm.. actually, try http://xx.xxx.xxxx/mysubdirectory/thanks.html in your browser and see if you see your format page. Otherwise, the form and code looks good to me except for the css class reference to which I am somewhat still ignorant. Oh, maybe delete the -error line for now so that you can get some feedback on the type of error, even if sometimes it's not true. And check that your field names match your objects and that those fields are on the "Web" layout... All stuff you know, I'm sure, but like you said, we're a little rusty at CDML.

--ST

Larry,

Try the [FMP-CurrentError] in the error.html page.

Good Luck.

Garry

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.