Jump to content

This topic is 7919 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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.

Posted

CDML -- HTML:


<form>

<input name="Date" type="text" id="Date" tabindex="9" value="[FMP-CurrentDate]" size="15">

</form>

Posted

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.

Posted

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

Posted

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?!

frown.gif 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...

Posted

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

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.