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.

Nesting FMP-IF in a form

Featured Replies

I have written a test-taking code for coaches, where there are two versions of the test: "A" and "B" and where there are variable questions at the end of the test, depending on the sport in which the coach is involved.

The problem is that I've tried nesting my "fmp-if" cdml inside of my form tags. This crashes FMP on my machine, when somebody tries to access the page. However, if I nest the form INSIDE of the "fmp-if" tag, it doesn't crash.

Is there a reason why this should happen? Is there someway around this (or else I have to have very long HTML to contain every full version of the test in its own form)?

Thanks

I have quite a few forms like this... something else might be wrong. Have you got the latest patch level of FileMaker Pro Web Companion, 5.0v6?

One way around is to use [FMP-Include] where the IFs contain references to the includes, the include files have the questions in them. Includes are handy for breaking things up so the bits can be reused and recycled, helping to prevent unnecessary duplication.

  • Author

It's still crashing, even when I tried to use include files. Is there a limit to how deep nested [fmp-if] and [else] statements can go? I need to have 6 different versions.

i've used up to 5 nest IF/else tags. . .

i would bet it's not in the coding. . .

sorry not much advice here. just filling you in on your "is there a limit?" question

Jeremy

[This message has been edited by yafreax (edited November 17, 2000).]

  • 2 weeks later...
  • Author

I'm still having troubles with this. I've tested the page, and when it's just the plain form, everything works fine. As soon as I add an "if" tag before and after the form, it freezes FMP.

Here's my code:

[FMP-IF: Field:test taken.eq.71]

<FORM ACTION="FMPro" METHOD="POST" web>

(form goes here)

</FORM>

[/FMP-IF]

Thanks again!

Are you using the <FORM ACTION="FMPro" METHOD="POST"> ... </FORM> syntax? Your post above has <FORM ACTION="FMPro" METHOD="POST" web> I dunno what the "web" will do, maybe that's it. Or is it a typo?

well i just wrote all this and hit the clear button rather than the submit button, oh well, here you go.

When i use the if tags , i use the following format. . .

[FMP-IF: testtaken.eq.71]

as opposed to your . . .

[FMP-IF: field:test taken.eq.71]

mine always works and i believe that it is the correct syntax. that could be your problem. Also, in general, you may not want to use spaces if you are publishing over the web. They can SOMETIMES (often) confuse the browser. I don't know if this is an issue when it is nested in an CDML tag, but i would think about an alternate method such as using Capitals to seperate (my fav. . . TestTaken) or underscores (test_taken) (everyone else's fav.)

Just some thoughts.

jeremy (yafreax)

------------------

Filemaker's kind of like a wife; easy to love, yet just so complicated.

  • Author

Well,

I fixed both problems. I guess that first one, with "web" in my form syntax was some weird typo. I also changed the fmp-if syntax, removing "field:"

Both these things temporarily alleviated the problem and I had it 1/2 way there (version "A" of the test, with 5 different questions at the end depending on sport coached, worked fine).

However, I tried to add "version B" by simply adding another fmp-if with a form inside (the exact syntax as the first one) and it crashed FMP again. So, I tried to use "if" and "else" instead of two separate "if"s, but that crashed, too. Any ideas? Is there a reason to use the "else" instead of "fmp-if testtaken.eq.b"?

Thanks.

Bevin

OK, back to basic trouble-shooting. Are you running the latest patch version of FileMaker Pro and Web Companion -- often there are separate versions of Web Companion. Fir instance, FMP 5.0v3 but WC 5.0v6. Find them at the FileMaker Pro web site

http://www.filemaker.com/support/updaters.html

Ditto for your computer's operating system. Does it have enough RAM to do the job? Is it a MAc or a PC?

also, why don't you let us see the syntax. . . Not everything within the tags, but somehting like. . .

[fmp if: testtaken.eq.71]

stuff (literally, write stuff)

[FMP if: testaken.eq.b]

stuff

etc. etc.

I really don't think that FM should crash even if the tags were wrong. Usually when i screw tags up i either get errors, or it just doesn't work, so eventually you are going to have to look deeper than tags and syntax.

Jeremy

  • Author

Well, guys, all your input kept telling me I MUST have some little wrong syntax somewhere. It's really simple code.

SO, I scrapped the whole thing and started again. And it works! The only thing that's holding me up now is the slow speed of my machine (Old Power Mac w/G3 processor) actually processing and returning the whole form. However, FMP 5 Unlimited and a new G4 are on the way to solve those issues.

If you want to check out your handiwork, go to: rook.princeton.edu/Certification

Thanks again!

Despite the fact that G3 is "old" it's way fast enough for a FMP server, as long as it's dedicated to the task, ie nothing else running on it.

There's people at http://www.proteron.com/ who make "FMPro Tuner" an extension that is meant to fix some small bug that prevents FMP from running optimally on MacOS. FMP 3 server and FMP4 client only.

I've been using it for a while with no ill effects, dunno if it actually speeds it up either. It's free so I got my money's worth.

I briefly looked at your site and noticed a couple of minor things.

Look at the way you are generating the value list for colleges, whether FMP-ValueList or FMP-Option. I think you want to use the -ValueList, but you're missing something because instead of getting <option value="Brown University">Brown University you're getting <option Brown University>Brown University.

I suspect that this is leading to the fact that any "OR" search yields the "Hartnett" record.

I prefer the cn instead of eq for an -op operator since it makes searches a bit more robust.(probably should be in quotes too)

Another tip for FMP-web design in general:

No spaces. Not in database names, layout names, and especially not in field names. There are loads of easy little form validation tools that can quickly be implemented in the web page using javascript, but not if there are spaces in the field names.

HTH

hey, i got into your test without filling information out in the first screen. You might want to make some of those required in FM. just a thought. (btw, i almost took the test just b/c of that reason above and i'm a sports nut and i was pretty curious about the test. . . I restrained myself, lest there be any confusion.)

yafreax

  • Author

I fixed the problems with spaces in my field names, but with the value lists, I'm just copying and pasting the codes from the Form Library in Homepage, inserting in my fields and value lists. I'll check it out further, but sorta lost on that one. Also, made my fields required.

Quick question about use of Javascripts (thinking about making a time limit on the test). Besides using javascript to make the page automatically go somewhere else after a certain time, is there a better way? Also, because this test will be used for official purposes, can I safely assume that the users' browsers all can use Javascript?

Thanks.

Most browsers support javascript, but you can check that they are and act accordingly.

A javascript countdown timer should be pretty easy (displaying on the page, if you like) and then going to another page when the time runs out. Since it will have to run and take action on the client machine in a web environment, you'll either be using javascript or java.

Here is a javascript example that should be cake to modify: http://javascript.internet.com/clocks/countup-down.html

[This message has been edited by dspires (edited November 30, 2000).]

  • Author

Okay, I have put a javascript timer on the page, and it will redirect after the allotted time. Question: how can I make it automatically submit the test through javascript? They won't be able to click the submit button. Is there a forum for using javascript with FMP?

Thanks!

Bevin

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.