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.

Popup Menu's and Linking

Featured Replies

This is probably more of an HTML question than a CDML one. But here goes:

I want to display a popupmenu in my page, that lists out the values in a field in FMPro. When any item of this list is selected, it will link to a url.

Does anyone have any example code? I can make the popupmenu easily. The linking is giving me trouble. Thanks in advance.

<a href="[fmp-field:urlstorage]">xxx</a>

Peace

Keith M. Davie

  • Author

right, but how does that work with this stuff:

<select size=4 name="Country">

<option value="F1" selected>France

<option value="G7">Germany

<option value="I4">Iceland

<option value="U2">USA

</select>

Maybe I'm thinking about this all wrong. I want this menu to work similar to the "Hop To" list on the bottom of these forum pages. Thanks again.

in the head of the html insert the following javascript:

<SCRIPT LANGUAGE="JavaScript"><!-- Begin

function formHandler(form){

var URL = document.form.site.options[document.form.site.selectedIndex].value;

window.location.href = URL;

}

// End --></SCRIPT>

then insert this where ever you want the popup menu.

<CENTER><FORM ACTION="" METHOD=POST name=form>

<CENTER><SELECT NAME=site onchange="javascript:formHandler()">

<OPTION VALUE=" ">Please Select . . .

<OPTION VALUE="URL TO HOP TO HERE">France

</SELECT></CENTER>

</FORM></CENTER>

and follow that format for the rest of the links. That however, is not going to give you a value in your FM field. So that may not be what you are looking for.

If you want it to actually put the value in the field, well, you are going to need an action tag such as -new or -edit assigned to a button.

jeremy

This code will jump to the associated Country_URL value when it is chosen in the pop-up list. This doesn't require the 'go' button.

<SELECT NAME="Country"

onChange="if(this.options[this.selectedIndex].value!='$'){window.open(this.options[this.selectedIndex].value,'_self')}">

<option VALUE="$" selected>Country 

<option VALUE="$">--------------- >

[FMP-valuelist: Country_URL]

<option VALUE="[FMP-valuelistitem]">

[FMP-valuelistitem]

[/FMP-valuelist]

</SELECT>

Just so you know, the one i use doesn't require a go button, either. It just goes, i'm sure your's work just fine wink.gif .

  • Author

How do I alter the text of the pop up menu's for either one of the JavaScript solutions posted?

Thanks,

Tim.

[This message has been edited by timmy (edited January 22, 2001).]

to edit the options that will display, substitute the text after the closing bracket , ">" , of the option line. For example, in the script i posted, where it says france, you would copy and paste that line as many time as needed replacing "France" with the text that you want displayed, (i.e. - "yahoo.com"). And replace the "URL TO HOP TO HERE" with the COMPLETE URL (i.e. - "http://www.yahoo.com").

also, javascript is picky about how the information in the head is typed so make sure that the breaks are where they are above.

hope this answers your question.

jeremy

  • Author

Are there any problems with this code and IE or Netscape? Does it work fine in both?

[This message has been edited by timmy (edited January 25, 2001).]

i haven't seen any problems with it, the best thing to do is test. . .

BUT in some cases, the user has altered the browser preferences and javascript will not work. But this usually isn't the case b/c javascript has a high volume usage and most users don't ever mess with their browswer preferences unless they are

A. stupid and want to play, then there is no hope anyway.

or B. they are advanced users and would probably never have a reason to turn javascript off.

(note, not all browsers, maybe not even most, have this option.)

and of course, everynow and then the browser application is corrupt and it won't do anything with javascript. I have seen this most often on IE 4.x for Macs

Over all i'd say your pretty safe for using it.

jeremy

[This message has been edited by yafreax (edited January 26, 2001).]

You can do alternative any HTML code <noscript> HTML code when JS is off </noscript>

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.