Jump to content

Nesting FMP-IF in a form


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

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...

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!

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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).]

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 8571 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.