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.

form action including <text area> field

Featured Replies

Somehow i have the feeling that i am doing something that is not allowed (with filemaker that is).

I have a form action to edit my records in a database. Within this form i have made a table for input of FMP fielddata and presenting other data form the record i am editing.

This all works great.

Now i came up with a code that makes me change the contents of a textarea by moving the mouse over a reference.

So, within the table i have one cell containing a <textarea name="updateme">

I also have a reference made:

<a href="#" onMouseOver="window.document.myform.updateme=

"yes it works">

When i put the textarea outside the form it works ok.

when i put the textarea inside the table of the filemaker form, after submitting i get an 101 error.

Now i have the feeling that inside the filemaker form i am not allowed to use fields that are not inside the filemaker layout.

Can someone explain me how i can get it to work.

I prefer to have the textarea field within the table because of layout considerations.

Can i "hide" the textare field from submitting to filemaker.

Thanks for any suggestions

Jitse

You will have to either, create a field called "updateme" or use:

<a href="#" onMouseOver="window.document.myform.elements[n]=

"yes it works">

Where "n" is the number of the form element (starting at 0).

Good Luck

Garry

  • Author

This is the code.

When i leave out the textarea field, everything is ok.

The moment i include the textarea i get an error 101

Any help is welcome

:

<SCRIPT LANGUAGE=javascript>

var T1="Achtergrond"

var T2="Analyse"

var T3="Aandachtspunten"

var T4="Typ. Ontwerpgegevens"

</SCRIPT>

<a href="#" onMouseOver="window.document.myform.the_textarea.value=

T1;">Achtergrond</a></BR>

<a href="#" onMouseOver="window.document.myform.the_textarea.value=

T2;">Analyse</a></BR>

<a href="#" onMouseOver="window.document.myform.the_textarea.value=

T3;">aandachtspunten</a></BR>

<a href="#" onMouseOver="window.document.myform.the_textarea.value=

T4;">Typ. Ontwerpgegevens</a>

<P><FORM name="myform" ACTION="FMPro" METHOD="POST">

<P><INPUT TYPE="hidden" NAME="-DB" VALUE="Webexpert">

<INPUT TYPE="hidden" NAME="-Lay" VALUE="L2">

<INPUT TYPE="hidden" NAME="-Format" VALUE="M1Ebackuptest1.htm">

<INPUT TYPE="hidden" NAME="-Error" VALUE="record_detail_error.htm">

<INPUT TYPE="hidden" NAME="-recid" VALUE="[fmp-currentrecid]"></P>

<CENTER>&nbsp;</CENTER>

<P><TABLE BORDER=1 ALIGN="Left">

<TR>

<TD WIDTH=231>

</TD>

<TD WIDTH=227>

</TD>

</TR>

<TR>

<TD WIDTH=231>

<P><FONT SIZE="-1">Gehalte Kjeldahl-stikstof in influent

&#91;mg N/l&#93;</FONT></P>

</TD>

<TD WIDTH=227>

<P><INPUT TYPE=text NAME=Nkjin VALUE="[FMP-Field: Nkjin]" SIZE=30></P>

</TD>

</TR>

<TR>

<TD WIDTH=231>

<textarea name="the_textarea" rows=10 cols=60></textarea>

</TD>

<TD WIDTH=227>

<P><INPUT TYPE="image" src="calcbutton.gif" NAME="-Edit"></P>

</TD>

</TR>

<TR>

<TD WIDTH=231>

<P><FONT SIZE="-1">Nitrificatiecap. installatie&#91;kg

N/dag&#93;</FONT></P>

</TD>

<TD WIDTH=227>

<P>[FMP-FIELD: NitrCap]</P>

</TD>

</TR>

</TR>

<TR>

<TD WIDTH=231>

<P><FONT SIZE="-1">[FMP-FIELD: M1]</FONT></P>

</TD>

</TR>

</TABLE>

</FORM>

</BODY>

</HTML>

It you make the <textarea tag look like this:

<textarea rows=10 cols=60></textarea>

and the <a tags look like this:

<a href="#" onMouseOver="window.document.myform.elements[6].value=

T1;">Achtergrond</a></BR>

<a href="#" onMouseOver="window.document.myform.elements[6].value=

T2;">Analyse</a></BR>

<a href="#" onMouseOver="window.document.myform.elements[6].value=

T3;">aandachtspunten</a></BR>

<a href="#" onMouseOver="window.document.myform.elements[6].value=

T4;">Typ. Ontwerpgegevens</a>

You will be fine.

WebCompanion is looking for the field named "the_textarea", this causes the error. If you remove the name, and refer to it by number this will stop the error.

All the best.

Garry

  • Author

OK garry, that works like a rock. Bow Bow.

How do you know that element[6] is the correct reference,

i mean how is the counting ?

Please explain otherwise i am into trial and error

Thanks Jitse

Jitse,

The counting is of the Form elements, i.e. <input, <textarea etc. It starts at 0. So the textarea is the seventh element in "myform".

All the best.

Garry

  • Author

Thanks gary,

I have been reading about the javascript document object model. Thau's javascript tutorial explains me some parts of the hierarchy of forms. it says that forms[] is an array of form objects with elements[] to be array of HTML form element objects: Button, Checkbox, Fileupload, Hidden, Password, radio, reset, Select, Submit, Text, Textarea. But what it does not explain is the order of the elements.

From your respons is gather the order is based on the HTML code.

Anyway it seems to be working.

Jitse smile.gif

You can have the same effect with:

document.forms[0].elements[6].value

As "myform" is the only form we know it is "0". However, if we inserted another form after it on the page the new form would be:

document.forms[1]

Hope this makes sense smile.gif

Garry

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.