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.

Using radio buttons to load another .xsl file

Featured Replies

  • Newbies

I have a Filemaker 6 CDML solution which I am trying to convert to xsl. Everything goes all right until I come to the page where there is a choice of 3 pages using radio buttons. On the previous page, user has logged in using username & password and this value has been passed to this page ok. The code I am trying to use for the radio buttons is as follows:

........usual header stuff

form method="post" xsl:attribute name="action"FMPro xsl:attribute

input type="hidden" name="-db" value="mydatabase"

input type="hidden" name="-lay" value="mylayout"

input type="hidden" name="-recid" value="{$default-record/@record-id}"

.............

input type="radio" xsl:attribute name="action" /fmi/xsl/test3/p2.xsl

View Page 2

.............

choice 2

choice 3

.............

input type="submit" name="-find" value="GO"

.............etc.

After making the choice and clicking on 'GO' a file not found error is generated.

I need the current record-id to be passed to the chosen page, so I can't use the URL for the file.

Any help would be gratefuuly appreciated.

There are several mistakes in your code.

- in FMS7A CWP, the action attribute can't be FMPro, it must be a XSLT file (e.g. action="/fmi/xsl/something.xsl") or a XML query (e.g. action="/fmi/xml/fmresultset.xml"

- you don't need the xsl:attribute tag as long as the content of the attribute is not dynamic. E.g. a simple <form method="post" action="youractionhere"> would do

- <input type="radio" can not have an action as attribute, only a name/value pair. See the HTML specification.

- if you want to post to different form actions upon selection of your radio button, you need JavaScript/DOM to achieve that. Then your action in the form tag must be empty and a JavaScript would set it and submit the form.

This would be an example (not tested by me, so please report mistakes):


<script language="JavaScript" type="text/javascript">

<xsl:comment>

<xsl:text disable-output-escaping="yes">

function gotopage() {

  if (document.myvariableform.actiontype[0].checked == true) {

    document.myvariableform.action = &quot;page1.xsl&quot;;

    document.myvariableform.submit();

    return true;

  } else if (document.myvariable.actiontype[1].checked == true) {

    document.myvariableform.action = &quot;page1.xsl&quot;;

    document.myvariableform.submit();

    return true;

  } else {

    alert(&quot;Please make a choice&quot;);

    return false;

  }

}

</xsl:text>

</xsl:comment>

</script>



<form method="post" name="myvariableform" action="">

<!-- add other required tags here -->

<input type="radio" name="actiontype" value="1"/><xsl:text>goto page1<xsl:text>

<input type="radio" name="actiontype" value="2"/><xsl:text>goto page2</text>

<input type="button" value="Go" onClick="return gotopage()"/>

</form>

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.