nati Posted October 3, 2002 Posted October 3, 2002 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
The Bridge Posted October 3, 2002 Posted October 3, 2002 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.
nati Posted October 3, 2002 Author Posted October 3, 2002 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
nati Posted October 3, 2002 Author Posted October 3, 2002 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
Garry Claridge Posted October 3, 2002 Posted October 3, 2002 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
Recommended Posts
This topic is 8188 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