May 28, 200322 yr does any one know how I can set a FM field on a webpage to the current date? By JS or just using FM? Thanks Hal.
May 28, 200322 yr It is possible both ways Easiest is through FM Create a calculation field for the date Status(CurrentDate) Place this field on your web page Javascript is a bit more involved. Ed.
May 28, 200322 yr IMHO -- there is also build-in function in WC and CDML. There will be difference in execution: 1. JS will have client date 2. CDML will have the date from FMU machine 3. the same will be for the Status method.
May 28, 200322 yr CDML -- HTML: <form> <input name="Date" type="text" id="Date" tabindex="9" value="[FMP-CurrentDate]" size="15"> </form>
May 28, 200322 yr Leb i Sol, I am unfamiliar with some of your code. What is " id="Date" tabindex="9""? Is this something new in FMPro6? I can't find any reference to id or tabindex in my HTML reference. Thanks.
May 28, 200322 yr sorry that has nothing to do with FM.... "id" is just a name of the field and "tabindex" sets the order ( HERE ) so could have used: <form> <input name="Date" type="text" value="[FMP-CurrentDate]"> </form> just as well
May 28, 200322 yr That tells me a lot. I've learned something. I'm glad I asked. Thank you. hmm...do I sense some irony in this post?! well...soooorrrry but this is the simple way of looking at it....follow the link above if u need more in-depth info but really that is all there is to it.It is up to u to use it...it is just a matter of how organized u want to be and how much u care about the code vs. funcitonality....my post/code was a snip soooo that is why it looked odd. anyway...
May 29, 200322 yr Author OK... I was not really clear. I want the user to be able to click a button on the details (edit) page that will set a date field to the current date. I also want them to be able to type in another date if they want to. I thought a JS attached to a button would be the easiest - just don't know how to do it? Any ideas would be appreciated. Cheers Halbj
May 29, 200322 yr There have been some lengthy threads on this (with Javascript). However, they may have been quite some time ago. In the <body>: <input type="hidden" name="mydate"> <a href="#" onclick="insDate();">Insert Date</a> In the <head>: <script> function insDate() { sToday = getDate() + "/" + getMonth() + "/" + getFullYear(); document.myform.mydate.value = sToday; } </script> Hope this helps. Garry
Create an account or sign in to comment