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.

Featured Replies

Hi!

My startpage have one field (date)that I search the db. If I find at least on record I can pass the value to the next page and I

Have you tried using [FMP-CurrentFind], and the related tags?

Please refer to your CDMLRD.

  • Author

Yes, I have tried [FMP-CurrentFind]. I doesn

Ok, that was just a guess and you hadn't said you'd tried it.

No, a token won't work because you will be unable to set it.

JavaScript may be your only hope. And that should prove tricky.

You can use some JS to set the token.X = to form element X

  

<script>

	  function TOKEN_PASS()	     

	   {	 

		 document.FORM_name.elements["-token.X"].value = document.FORM_name.elements[X].value;	      

		 document.FORM_name.submit();	     

	   };

</script>



JS credits: Garry

However, I don't know if the token will get passed to an -error page...it "should" but I have not tested it.

I hope it helps

  • Author

I will try it immediately

  • Author

My startpage look like this with the JS:

...

<form method="post" action="FMPro">

<input type="hidden" name="-db" value="booking.fp5">

<input type="hidden" name="-lay" value="in">

<input type="hidden" name="-format value="search_show_day.htm">

</tr>

<tr>

<td></td>

<td>yyyy-mm-dd</td>

<td></td>

</tr>

</table> <input type="hidden" name="-error" value="search_error.htm">

<input type="hidden" name="-SortField" value="computer">

<input type="hidden" name="-SortOrder" value="Ascending">

<input type="hidden" name="-SortField" value="time">

<input type="hidden" name="-SortOrder" value="Ascending">

<input type="hidden" name="-op" value="eq">

<input type="hidden" name="-Find">

<input type="hidden" name="-Token" value="[FMP-Field: date]">

<script>

function TOKEN_PASS()

{

document.FORM_name.elements["-Token"].value = document.FORM_name.elements[x].value;

document.FORM_name.submit();

};

</script>

<td width="34%"><div align="right"><strong>Date:</strong></div></td>

<td width="31%"> <input name="date" type="text" size="15"> </td>

<td width="35%"><input type="submit" name="-Find" value="Search"></td>

</form>

...

And my error-page look like this:

...

<input name="date" type="text" value="[FMP-CurrentToken]">

...

And it returns [FMP-Field: date] in the input field.

I don't think you understood me correctly

"document.FORM_name.elements[x].value;"

is a general format...you have to count how many elements you have in the form...text fields or drop lists OR Hidden fields are counted as 1 each. so if your text field is 3rd in the form it would be

document.FORM_name.elements[3].value;

also your form has to have a name "FORM_name" is a general format.

so:

<form action="FMPro" method="post" name="FORM_name" >

also the <script> should go above HEAD tag in HTML and then called with submition. sooooo

  

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>Token Set to the Nth Element of a Form</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script>

function TOKEN_PASS()

{ 

document.FORM_name.elements["-Token"].value = document.FORM_name.elements[8].value;

document.FORM_name.submit();

};

</script>

</head>

<body>

<form action="FMPro" method="post" name="FORM_name" onSubmit="TOKEN_PASS();">

  <input type="hidden" name="-db" value="booking.fp5"> <!-- 1st element -->

  <input type="hidden" name="-lay" value="in"><!-- 2nd element -->

  <input type="hidden" name="-format" value="search_show_day.htm"><!-- 3rd element -->

  <input type="hidden" name="-error" value="search_error.htm"><!-- 4th element -->

<input type="hidden" name="-SortField" value="computer"><!-- 5th element -->

<input type="hidden" name="-SortOrder" value="Ascending"><!-- 6th element -->

  <input type="hidden" name="-op" value="eq"><!-- 7th element -->

  <input name="date" type="text" id="date"><!-- YOUR NUMBER 8 element -->

  <input name="Submit" type="submit" value="Submit">

  <input type="reset" name="reset" value="Reset">

</form>

</body>

</html>

also I would look into CDML reference for "-Token"

now go get lucky smile.gif

  • Author

ok. Thanks!

Javascript is not my cup of tea...

blush.gif

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.