Jump to content

[FMP-Field:] Question


Chirriras
 Share

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

Recommended Posts

I have a small page I post to keep clients up to date on the number of surveys received. Before I decided to dive into this stuff over my head, I used to put up a simple FMP layout using IWP. Now that I've switched to CWP, I need to set this page up from scratch. I have six fields, 3 are summaries of the number of surveys received, the number returned as invalid, and the number remailed with a corrected address. The other three fields figure the percentage of these three items.

I set the fields up like this:

<input type="text" name="Total_Received" value="[FMP-Field:Total_Received]">

When I open it in my browser, in the box where numbers should appear, I get [FMP-Field:Total_Received] instead. I have a feeling that the problem is "text" when the field is not a text field, it is a summary or calculation field. Is there any way to make this work?

Link to comment
Share on other sites

No, I don't think that has anything to do with it. Summary and calculation fields should output correctly on the browser. Whatever appears in your filemaker database should appear correctly on your browser. How are you calling upon this page? Do you have another page that has a form and the format of that form is this page? If so, I did the same thing just a while ago, I had an xsl stylesheet and had a form in it. In the form I had <input type=hidden" name="-styletype" value="text/xsl"/>

<input type="hidden" name="-stylehref" value="myxsl.xsl"/>

And then the problem was that whenever you call an xsl stylesheet the format of the form must be <input type="hidden" name="-format" value="-fmp_xml"/>

But I had the format as a CDML page. So I was calling a stylesheet with the two previous inputs but at the same time trying to get a CDML page to load in the browser.

So with the [FMP-Field:Total_Reveived], if that was my field, would appear just as that in the browser and not the numbers in the filemaker field.

I am sure it is probably just that sort of problem. Just go and check you have websharing enabled in both the edit/preferences/application menu, and also the file/sharing option in the plugins.

Justin Grewe

Link to comment
Share on other sites

Nope, nothing fancy, just short and sweet (that's all I know how to do at this point).

<FORM ACTION="FMPro" METHOD="post">

<INPUT TYPE="hidden" NAME="-DB" VALUE="Filename.fp5">

<INPUT TYPE="hidden" NAME="-FORMAT" VALUE="thankyou.htm">

<INPUT TYPE="hidden" NAME="-LAY" VALUE="stats">

I have used the CDML Reference to set this up, and it makes no sense to me at all. It seems, logically, that it should simply transfer what is on the FMP screen to the web screen, but it doesn't--instead it displays the tag.

Link to comment
Share on other sites

Hi, sorry if this is being too obvious, but are you calling the page through an action like

"http://www.mydomain.com/thedirectory/FMPro/-db=mydatabase&-format=mypage.htm&-View

or just:

http://www.mydomain.com/thedirectory/mypage.htm

in the second case, Filemaker will deliver the page, but not process any tags

Also, if youjust want to show it on the page rather than in an editable form box, the tag is just:

[FMP-FIELD: ]

which you can treat like any other text:

<FONT FACE="verdana">[FMP-FIELD: ]</FONT>

jeff

Link to comment
Share on other sites

Hi, E.D.! It annoyed me at first (I guess it still does), but Jeff is right. You cannot display information from your database without first performing a Filemaker action. In his example, he used -view but you can also use -find, -edit, -new, etc. If you have don't really need to perform a specifc action, use something like -view or -findany.

To display data on your "1st" web page presented to the user, you have to use a CDML URL to get to the page with the desired page being the -format page which you define in the URL. Another common workaround is to use a META tag to automatically redirect users to the desired page. This lets them type a simpler URL but gets them where you want them to go. I've also used a redirect page (-findany) and then used INLINE ACTIONS to show my info, but that's up to you and what you're up to doing.

EX URL all on one line but broken in parts here for formatting:

http://

yourdomain.com/FMPro?-db=yourdatabase.fp5

&-format=yourwebpage.html&-lay=weblayout&-error=error.html&-findany

Hope this helps! --ST

(Hm.. seem to be having trouble avoiding the auto-URL-izing of the sample link.... just put it all on one line w/no spaces)

P.S. Here is a sample redirect META tag. You can use this something like this w/no other content on it to take folks to your desired page...

<META HTTP-EQUIV="Refresh" CONTENT="7; URL=

http://www.mydomain.com/thedirectory/FMPro/-db=mydatabase&-format=mypage.htm&-View">

Link to comment
Share on other sites

Sometimes we get too bogged down in geek-speak. Maybe I can simplify this for the original poster:

Your first web page would contain the form you've got

<FORM ACTION="FMPro" METHOD="post">

<INPUT TYPE="hidden" NAME="-DB" VALUE="Filename.fp5">

<INPUT TYPE="hidden" NAME="-FORMAT" VALUE="thankyou.htm">

<INPUT TYPE="hidden" NAME="-LAY" VALUE="stats">

but with an additional input:

<INPUT TYPE="submit" NAME="Search" VALUE="-findAll">

</form>

or it could contain this simple (or maybe complex!) link:

http://123.45.678.901:591/FMPro?-db=Filename.fp5&-format=thankyou.htm&-lay=stats&-findany

(This link would replace your original one: http://123.45.678.901:591/pagename.htm)

Your second page (thankyou.htm) contains the fields you want displayed by the result of your search from page 1. In this case the search will find every record in the db (-findAll). You can display the result of this search two ways:

<input type="text" name="Total_Received" value="[FMP-Field:Total_Received]">

or more simply

[FMP-Field:Total_Received]

Hope this helps you.

Link to comment
Share on other sites

Nicely put, Robert jonesy!

So, Tucker... The 1st page sets up the search and the 2nd page shows the info from your database. The long, stringy URL works the same as the 1st page if you don't want 2 pages. Robert uses -findany but mentions -findall... I think -findany will be quicker.

--ST

Link to comment
Share on other sites

  • Newbies

Thank you, guys! This was a problem I was having, too.

The trick was to use the URL with the "FMPro?-db=mydatabasefind&-lay=MainLayout&-format=search.htm&-view" after the ip.

I do not really understand the two page method as proposed by Jonesy17. In that example the field (or in my case a value list) will not display for use in a search form will it? (for example check boxes).

While on the topic of check-boxes, etc how do you format them on your web page so they are all nicely alligned? What I have is this:

<P><FONT COLOR="#FFFFFF">

<INPUT TYPE="hidden" NAME="-op" VALUE=cn>

[FMP-VALUELIST: Disciplines, LIST=DisciplinesValueList]

<FONT COLOR="#FFFFFF">

<INPUT TYPE=checkbox NAME=Disciplines VALUE="[FMP-ValueListItem]">[FMP-VALUELISTITEM: Always, HTML]</FONT>

[/FMP-VALUELIST]</FONT></P>

and there are quite a few choices and I'd like to arrange them neatly.

Link to comment
Share on other sites

"I do not really understand the two page method..."

Web Companion responds to a URL with a simple request (for a file or image) by just sending the file back to the user with the minimum of fuss. An example of this could be:

www.host.com/solution/detail.htm

If you want WC to process the codes in the CDML format file you'll have to tell WC (at a minimum) what database is being queried, what layout to use, what CDML format file to process, and what action it needs to perform. An example of this could be:

www.host.com/solution/FMPro?-db=file.fp5&-lay=Web&-format=detail.htm&-view

Ideally you get the user to click on a the link above or type the address into their browser directly. But that's not reasonable since the url above doesn't look like a normal web address and it's way too hard to remember (not like, say, "www.host.com/solution"). So instead you direct people to...

www.host.com/solution/index.html

... where index.html has a meta-redirect that immediately sends people to the ugly-but-functional action link.

There are, of course, other ways of doing it that might use PHP or ASP or Java or other server-side technology, but the two-page technique is the simplest and adequately reliable.

Link to comment
Share on other sites

Hi, Isaiah4031! RE: CHECKBOX ALIGNMENT

If you can afford vertical space, just add <BR> after the VALUELIST ITEM so they stack. If you must go horizontal with one after the other, add a non-breaking space or a spacer graphic or something. If you want exact character lengths, I think you'd have to compute them and it's probably not worth the trouble. You can also hardcode your check boxes instead of using the valuelist. --ST

Link to comment
Share on other sites

  • Newbies

I had replied to Vaughan on this once already, but for some reason it didn't show up on here. Thank you Vaughan, and I had thought that was what was meant, but I wasn't sure.

Steve T., thank you, also for your help and both of you for the quick replies! Yes, the <BR> worked for vertical alignment. That's great! It's still not really pretty (I'm so hard to please! :.

(For those reading this who aren't quite clear where to put it here's where it goes):

<P><FONT COLOR="#FFFFFF">

<INPUT TYPE="hidden" NAME="-op" VALUE=cn>

[FMP-VALUELIST: Disciplines, LIST=DisciplinesValueList]

<FONT COLOR="#FFFFFF">

<INPUT TYPE=checkbox NAME=Disciplines VALUE="[FMP-ValueListItem]">[FMP-VALUELISTITEM: Always,

HTML]</FONT>

[/FMP-VALUELIST]<BR></FONT></P>

I'll play around with your other two ideas over the next couple days, Steve. I'm not really sure how to do either of your last two suggestions, but I've got some ideas (such as using the <SPACER TYPE=horizontal SIZE=15> tag, for example). I'll let you know what happens.

Brad

Link to comment
Share on other sites

Hi, Brad! Well, if you want to use tables, for example, to control the exact position of each check box (say, 2 rows of 4 each), you can manually type out the values of the valuelist and put them singly in each cell. If your valuelist had exactly 8 values, you would have exactly 8 checkboxes. When you use the FMP-VALUELIST tag, you only have 1 checkbox that is automatically repeated for each value list item.

Hmm... I'm not a very good coder. I wonder if you can set it up so a new table cell is created everytime a valuelist item is shown?

--ST

Link to comment
Share on other sites

  • Newbies

Ok, I think I've got this figured out. To manually construct it enter the following code...

<P><INPUT TYPE=checkbox NAME=ThisIsTheFieldNameInYourDatabase VALUE=ThisIsTheNameOfItem#1InYourValueList>ThisIsWhatYouWantToAppearBesideTheFirstCheckBoxInTheWebBrowser</P>

<P><INPUT TYPE=checkbox NAME=ThisIsTheFieldNameInYourDatabase VALUE=ThisIsTheNameOfItem#2InYourValueList>ThisIsWhatYouWantToAppearBesideTheSecondCheckBoxInTheWebBrowser</P>

...etc.

After this, you can take each of these items and put it into a cell in your table.

If I understand correctly you don't need any operators in here, but I'm not sure. If I do (or if I wanted them), then I definately do not know how to construct it appropriately. Secondly, it also seems that you don't need to mention anything about it being a ValueList. Am I correct, or am I totally wrong on these observations?

Brad

Link to comment
Share on other sites

Hi, Brad! No, I think that's it. One of the downsides to manual coding , though, is that it's... well, manual. If you change your valuelist, you'll have to recode your web page. BTW, IMO checkboxes are not straight forward and require extra attention. There's some good checkbox posts by Jeff Spall I remember if you need more info.

--ST

Link to comment
Share on other sites

This topic is 6534 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
 Share

×
×
  • Create New...

Important Information

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