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.

Sort Again Form in pop-up menus?

Featured Replies

Hello again.

I'm back on coding a "sort again" form made of pop-up menus as much as possible because complex searches and sorts exeed hyperlink lenght and internet real-estate (screen space) is usually precious.

Intro: After a typical -find request is made to FMP, it returns the found set through a format file.

127.0.0.1/en/FMPro?-db=jobs.fp5&-lay=JobsListLayout&-format=JobListDefault.html

Find items:

&-lop=and&-op=eq&Country=Canada&-op=gt&Salary=50000

Sort items:

&-sortfield=PostingDate&-sortorder=descend&-sortfield=Salary&-sortorder=descend

Navigation items:

&-max=10&-skip=20

Other items:

&-token.0=error.html&-Find

The "sort again form" is to be put before or after all [FMP-Record] [/FMP-Record] pairs on the returned web page so web users can *add/modify/delete* Sort Item/Order of their find request.

====

Specs: FMPro 5.5v.2 and WebCompanion 5.5v3 at IP 127.0.0.1

with Netscape 4.79 and Mac OS 8.6 on a standalone PPC 603e. eh!

====

1.0 The returned page:

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">

HTML...HEAD...TITLE.../TITLE.../HEAD..BODY TEXT="#000000" BGCOLOR="#FFFFFF"

<!-- First table is for the developer and shows in text the request -->

<TABLE><TR><TD><FONT SIZE=2>[FMP-Link]</FONT></TD></TR></TABLE>

2.0 Keeping unchanged request values:

<!-- Second table is for the sort again form in pop-up menus-->

<TABLE><TR><TD>Search Again Form

<!-- Form is started in first TD because it generates a carriage return in the browser-->

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

<INPUT TYPE="hidden" NAME="-db" VALUE="[FMP-CurrentDatabase: HTML]">

<INPUT TYPE="hidden" NAME="-lay" VALUE="[FMP-CurrentLayout: HTML]">

<INPUT TYPE="hidden" NAME="-format" VALUE="[FMP-CurrentFormat]">

<INPUT TYPE="hidden" NAME="-skip" VALUE="[FMP-CurrentSkip]">

<!-- Keeping the Lop, find fields and find values -->

<INPUT TYPE="hidden" NAME="-lop" VALUE="[FMP-CurrentLOP]">

[FMP-CurrentFind]

<INPUT TYPE="hidden" NAME="-op" VALUE="[FMP-FindOpItem]">

<INPUT TYPE="hidden" NAME="[FMP-FindFieldItem]" VALUE="[FMP-FindValueItem]">

[/FMP-CurrentFind].

</TD>

3.0: Changing Sort items: -SortField, -SortOrder

The web user asked to sort on 2 fields: PostingDate:descend, Salary:descend

I'd like the form to offer 2 pop-ups with each the two values to choose from so they can then sort on Salary first, Posting date second. It should work with 3 or more sorts:

The page would show:

<!-- the first sort field was PostingDate -->

<SELECT NAME="-SortFieldItem">

<OPTION VALUE="PostingDate" SELECTED>PostingDate

<OPTION VALUE="Salary">Salary

</SELECT>

<SELECT NAME="-Sortorder">

<OPTION VALUE="ascend">ascend

<OPTION VALUE="descend" SELECTED>descend

</SELECT>

<!-- the second sort field was PostingDate -->

<SELECT NAME="-SortFieldItem">

<OPTION VALUE="PostingDate">PostingDate

<OPTION VALUE="Salary" SELECTED>Salary

</SELECT>

<SELECT NAME="-Sortorder">

<OPTION VALUE="ascend">ascend

<OPTION VALUE="descend" SELECTED>descend

</SELECT>

<TD ALIGN=RIGHT WIDTH=15% ><INPUT NAME="reset" TYPE="reset" VALUE="Reset"></TD>

<TD ALIGN=RIGHT WIDTH=15% ><INPUT NAME="-find" TYPE="submit" VALUE="Sort Again!">

</FORM></TD>

</TR></TABLE>

======

Couldn't use [FMP-If: SortfieldItem .eq. Something]

Couldn't use [FMP-If: Something .eq. {SortfieldItem}]

Couldn't use Radio Buttons format becase they would all switch toghether on the web page:-!

Couldn't use [FMP-FieldName] because FMP uses the same layout for finding and returning field values so too many fields apear in the pop-up menu.

Couldn't use [FMP-ValueList: FindFieldItems] because it expects a field name, not a tag.

Couldn't cacade [FMP-CurrentSort]

[FMP-CurrentSort]

<SELECT NAME="-SortFieldItem">

<OPTION VALUE="">Remove Sort

[FMP-CurrentSort]

<INPUT TYPE="hidden" NAME="-sortfield" VALUE="[FMP-SortFieldItem]">

<INPUT TYPE="hidden" NAME="-sortorder" VALUE="[FMP-SortOrderItem]">

[/FMP-CurrentSort]

</SELECT>-

<SELECT NAME="-Sortorder">

<OPTION VALUE="ascend">ascend

<OPTION VALUE="descend">descend

</SELECT> /

[/FMP-CurrentSort]

====

So, what can I do to parse SortFieldItems And SortOrderItems?

====

Notes:

Replacement tags usable with [FMP-IF]

CurrentError, CurrentFoundCount, CurrentMax, CurrentRecordCount, CurrentRecordNumber, CurrentSkip, RangeEnd, RangeSize, RangeStart

Text comparisons

ClientPassword, ClientType, ClientUsername, CurrentAction, CurrentCookie, CurrentDatabase, CurrentFormat, CurrentLayout, CurrentToken

====

  • Author

I'm happy no one had time to reply about my previous post's mistakes.

======

<!-- the second sort field was PostingDate -->

should have read:

<!-- the second sort field was Salary -->

======

<SELECT NAME="-SortFieldItem">

should have read

<SELECT NAME="-Sortfield">

======

Couldn't cacade [FMP-CurrentSort]

[FMP-CurrentSort]

<SELECT NAME="-SortFieldItem">

<OPTION VALUE="">Remove Sort

[FMP-CurrentSort]

<INPUT TYPE="hidden" NAME="-sortfield" VALUE="[FMP-SortFieldItem]">

<INPUT TYPE="hidden" NAME="-sortorder" VALUE="[FMP-SortOrderItem]">

[/FMP-CurrentSort]

</SELECT>-

<SELECT NAME="-Sortorder">

<OPTION VALUE="ascend">ascend

<OPTION VALUE="descend">descend

</SELECT> /

[/FMP-CurrentSort]

Should have read

*Can now* cascade [FMP-CurrentSort] but still can't position SELECTED exept by repeating SortfieldItem as 1st choice of pop-up menu.

[FMP-CurrentSort]

<SELECT NAME="-SortField">

<OPTION VALUE="[FMP-SortFieldItem]" SELECTED>[FMP-SortFieldItem]

<OPTION VALUE="">Remove Sort

[FMP-CurrentSort]

<OPTION VALUE="[FMP-SortFieldItem]">[FMP-SortFieldItem]

[/FMP-CurrentSort]

</SELECT>-

<SELECT NAME="-Sortorder">

<OPTION VALUE="[FMP-SortOrderItem]" SELECTED>[FMP-SortOrderItem]

<OPTION VALUE="ascend">ascend

<OPTION VALUE="descend">descend

</SELECT> /

[/FMP-CurrentSort]

Francois who hopes the "Sort Again Form" problem will yeild answers to the "Find Again Form in pop-up menus" problem.

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.