Jump to content

This topic is 7868 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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.

Posted

"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

Posted

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

Posted

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.

Posted

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

Larry

Posted

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
Posted

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

This topic is 7868 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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