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.

FMP-If included in the submit part of a -edit form

Featured Replies

In using a -edit form with a submit button, is there a way to include a FMP-If tag so that when the user hits submit, depending on the If statement, they are routed to one of two -format files. For example here is a standard -format use:

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

Can it be changed to something like:

[FMP-If: answer1 .eq. Yes]<INPUT TYPE="hidden" NAME="-format" VALUE="surveystep1.html">

[FMP-ElseIf: answer1 .neg. Yes]<INPUT TYPE="hidden" NAME="-format" VALUE="surveystep2.html">

[/FMP-If]

The logic of this seems right, but I was wondering if anyone had tried anything like it?

LR

[FMP-If: lalalal

[FMP-Else: ooooo

[/FMP-IF]

Definitely not, or I didn't understand the question. Not on page where is the Submit button.

On called format page yes, it can be possible with If to display one or another part of format page.

"Not on page where is the Submit button. On called format page yes,..."

would tranlate into:

=============================

FormPage.html with the entry of an "answer1" --->[iF page with the dynamic input BUT ONLY to direct to different page not different action of -edit-new] + SUBMIT to ---> ResultsPage.html

===================

this is what I assumed and see no reason why it would not work!

but the -edit part laugh.gif

  • Author

I gave it a shot using this:

<input type="hidden" name="-RecID" value="[FMP-field:CurrentRec]">

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

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

[FMP-If:If2A .eq. Yes]<INPUT TYPE="hidden" NAME="-format" VALUE="surveystep3.html">

[FMP-Else:If2A .neq. Yes]

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

[/FMP-If]

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

<input type="submit" name="-Edit" value="Continue">

But it did not seem to work, keep getting format file not found error. So apparently the If part pointing to the correct -format file is not quite right. I will have to keep playing with it.

LR

Hi,

I have done something similar to what you are doing but have done the "If" on the database rather than the web page.

On the web page I entered:

<INPUT TYPE="hidden" NAME="-format" VALUE="[FMP-FIELD: c_FormatPage]">

Then in the database:

c_Formatpage= if answer = "yes", "surveystep1.html", "surveystep2.html"

Ed.

  • Author

OK, now that one makes sense. Thanks for pointing to a solution from a different direction. I will give that one a try.

Larry

again:

Syntax

[FMP-If: LeftSide Operator RightSide ]

...HTML if condition is true...

[FMP-Else]

...HTML if condition is false...

[/FMP-If]

==========================================================

try:

IF this

ELSE that NOT ELSE IF

in general:

IF ....

____Elseif...

____endif

ENDIF

or use the post above...although I prefer changing the name of the page in the HTML and validating links vs. going back to database and changing it...the same thing though

all the best

  • Newbies

ibiubu said:

<input type="hidden" name="-RecID" value="[FMP-field:CurrentRec]">

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

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

[FMP-If:If2A .eq. Yes]<INPUT TYPE="hidden" NAME="-format" VALUE="surveystep3.html">

[FMP-Else:If2A .neq. Yes]

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

[/FMP-If]

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

<input type="submit" name="-Edit" value="Continue">

[FMP-If:If2A .eq. Yes]

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

[FMP-Else]

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

[/FMP-If]

using the correct syntax for the FMP-if, this should be fine -I do similar things often with no problems

reading posts often prevents duplicates

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.