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.

How to activate a form while loading a page?

Featured Replies

How can I activate a form when sombody loads my pages on the web?

Say that, that form should create a record in a specified database.

Abkaplan

do you mean you want to form to automatically submit when the page is loaded???

if not please post back and be alittle more specific??

I am login access to each page into db with Inline processing in FM 5.

If you just want to create new record after submission use -NEW.

  • Author

Dear Bman;

You are right, I want automatic submission of a form while loading a page.

(it may ask a confirmation message or may not.)Just like activating a JS

Dear Anatoli;

I said new record as an examle ( any action I want ) , but that new record shold be created automatically when somebody write url on the adress line and press enter.As far as I know it can be done automatically by the submission of a form while loading a page but how?

Thanks for your immediate answers.

Abkaplan

The simple way is write Inline -New record.

If someone will ask for page from FM webcompanion via URL, that requested page has this inline action somewhere in body.

  • Author

Dear Anatoli;

Thanks for your message. But I haven't used an "inline" action yet. If you send me a specific sample code I will be very glad. ( where to put how to write that code.)

Abkaplan.

(I have already started to change all my scripts to new record or edit forms. a lot of thanks to all those that inform me about the scripts on the web )

Use the onload event handler with the <body> tag. E.G. <body bgcolor="white" onload="top.main_head.document.location.replace('../FMPro?-db=v5pd.fp5&-format=/pages/head_agenc.html&-token=[FMP-Field:code]&-view');">

Hope this helps.

Garry

ps. I had to put around the word onload so that this message would work.

quote:

Originally posted by abkaplan:

Dear Anatoli;

Thanks for your message. But I haven't used an "inline" action yet. If you send me a specific sample code I will be very glad. ( where to put how to write that code.)

Abkaplan.


Place somewhere in page:

[FMP-InlineAction: -db=prtzlog.fp5, key={CurrentToken: 3}, TZnSz=AK, Tzid={field:ID}, -New] [/FMP-InlineAction]

This is standard CDML for FM 5.

Inline is executed before sending the page to the browser. In this case the database used will be prtzlog.fp5, New record will be created and fields key, TZnSz and Tzid will be populated by values.

Then the control will be returned to the database, which is called by link triggering this page.

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.