October 3, 200223 yr hello, I want to set the field Date in the database with the value of current date. <FORM ACTION="FMPro" METHOD="post"> <INPUT TYPE="hidden" NAME="-db" VALUE="Main.fp5"> <INPUT TYPE="hidden" NAME="-lay" VALUE="main"> <INPUT TYPE="hidden" NAME="-format" VALUE="mainmenu.html"> <INPUT TYPE="hidden" NAME="Field1" VALUE="Done"> <INPUT TYPE="hidden" NAME="Date_field" VALUE="[FMP-CurrentDate]"> </FORM> but I receive the error "your attempt to edit failed because of the following error:" then a scroll bar which I cannot scroll so I cannot read it. The field Date_field is a date field. Thanks you, nati
October 3, 200223 yr The form has to be submitted in order to get a result. How about something like: [FMP-IF: Test .eq. Yes] <FORM ACTION="FMPro" METHOD="POST" name="TestForm"> <INPUT TYPE="hidden" NAME="-db" VALUE="Main.FP5"> <INPUT TYPE="hidden" NAME="-lay" VALUE="main"> <INPUT TYPE="hidden" NAME="-format" VALUE="finish.htm"> <INPUT TYPE="hidden" NAME="-error" VALUE="searcherr.html"> <INPUT TYPE="hidden" NAME="-RecID" VALUE="[FMP-CurrentRecID]"> <INPUT TYPE="hidden" NAME="-Token" VALUE="[FMP-CurrentRecID]"> <INPUT TYPE="hidden" NAME="-Script" VALUE="Date_SCRIPT"> <INPUT TYPE="image" border="0" name="-edit" src="images/print.gif"> </FORM> <script> document.TestForm.submit() </script> [FMP-ELSE] <img src="images/print_2.gif" width="152" height="25"> [/FMP-IF] Note: I haven't actually tried this, but it's worth a shot.
October 3, 200223 yr Author hello bridge, Yes, I decided to just try the input type instead so I changed the post (so possibly nobody know what you are talking about now!) but this is good idea that I will look at. thanks, nati
October 3, 200223 yr Author Just another note, if I remove the <INPUT TYPE="hidden" NAME="Date_field" VALUE="[FMP-CurrentDate]"> then the field Field1 is being set to "Done" and no error message. thanks, nati
October 3, 200223 yr Nati, Two ways to do this: 1. Use a script to update the 'date_done' field. 2. Use some Javascript to insert the date into the form. Here is the Javascript: This is between the HEAD tags: <script language="Javascript"> dToday = new Date(); sToday = dToday.getMonth() + "/" + dToday.getDate() + "/" + dToday.getFullYear(); </script> This is in the FORM: <script>document.write('<input type="hidden" name="date_done" value="' + sToday + '">');</script> Hope this helps. All the best. Garry
Create an account or sign in to comment