halbj Posted May 28, 2003 Posted May 28, 2003 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.
EddyB Posted May 28, 2003 Posted May 28, 2003 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.
Anatoli Posted May 28, 2003 Posted May 28, 2003 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.
Leb i Sol Posted May 28, 2003 Posted May 28, 2003 CDML -- HTML: <form> <input name="Date" type="text" id="Date" tabindex="9" value="[FMP-CurrentDate]" size="15"> </form>
Unable Posted May 28, 2003 Posted May 28, 2003 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.
Leb i Sol Posted May 28, 2003 Posted May 28, 2003 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
Unable Posted May 28, 2003 Posted May 28, 2003 That tells me a lot. I've learned something. I'm glad I asked. Thank you.
Leb i Sol Posted May 28, 2003 Posted May 28, 2003 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...
halbj Posted May 29, 2003 Author Posted May 29, 2003 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
Garry Claridge Posted May 29, 2003 Posted May 29, 2003 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
Recommended Posts
This topic is 7919 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