JitseSchaafsma Posted February 17, 2003 Posted February 17, 2003 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
Garry Claridge Posted February 17, 2003 Posted February 17, 2003 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
JitseSchaafsma Posted February 17, 2003 Author Posted February 17, 2003 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> </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 [mg N/l]</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[kg N/dag]</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>
Garry Claridge Posted February 17, 2003 Posted February 17, 2003 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
JitseSchaafsma Posted February 17, 2003 Author Posted February 17, 2003 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
Garry Claridge Posted February 18, 2003 Posted February 18, 2003 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
JitseSchaafsma Posted February 18, 2003 Author Posted February 18, 2003 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
Garry Claridge Posted February 18, 2003 Posted February 18, 2003 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 Garry
Recommended Posts
This topic is 8340 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now