# Current Date in Form Field - HTML Troubles

**URL:** <https://forums.realmacsoftware.com/t/current-date-in-form-field-html-troubles/27888>\
**Category:** RapidWeaver Classic\
**Created:** [July 17, 2019, 10:54am UTC](https://forums.realmacsoftware.com/t/current-date-in-form-field-html-troubles/27888 "2019-07-17T10:54:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![labanbrown](https://avatars.discourse-cdn.com/v4/letter/l/9fc348/32.png) [@labanbrown](https://forums.realmacsoftware.com/u/labanbrown)\
**Post date:** [July 17, 2019, 10:54am UTC](https://forums.realmacsoftware.com/t/current-date-in-form-field-html-troubles/27888/1 "2019-07-17T10:54:17Z")

</div>

Hi there. I’m trying to get an inserted html form in Foundry to show the current date in a field. I’ve tried all kinds of routes (from plenty of Google searches) - does anyone have a clever solution to be able to do this?

I currently have this but it only seems to work in Safari. Both Firefox and Chrome insert a date picker which is odd?

Current HTML:

 

Javascript:  
function TodayDate(){  
let data= new Date();  
return data.getFullYear().toString()+’-’ + (data.getMonth()+1).toString()+’-’ + data.getDate().toString()  
}  
document.getElementById(‘today’).innerHTML = ‘  
’;

Any help gratefully received! Cheers

---

<div class="post-metadata">

**Author:** ![manofdogz](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/manofdogz/32/26314_2.png) [@manofdogz](https://forums.realmacsoftware.com/u/manofdogz)\
**Post date:** [July 17, 2019, 4:21pm UTC](https://forums.realmacsoftware.com/t/current-date-in-form-field-html-troubles/27888/2 "2019-07-17T16:21:43Z")

</div>

Not sure what form you are using and whether you can actually put javascript into the form fields. However, this should work in any php page:

\<input type=‘date’ id=‘hasta’ value=’\<?php echo date('Y-m-d');?\>’\>

Also, if you use Formloom 4, you can set the datepicker to enter todays date by default.

---

<div class="post-metadata">

**Author:** ![labanbrown](https://avatars.discourse-cdn.com/v4/letter/l/9fc348/32.png) [@labanbrown](https://forums.realmacsoftware.com/u/labanbrown)\
**Post date:** [July 17, 2019, 6:48pm UTC](https://forums.realmacsoftware.com/t/current-date-in-form-field-html-troubles/27888/3 "2019-07-17T18:48:39Z")

</div>

Thanks - will give that a try…

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/system/32/25301_2.png) [@system](https://forums.realmacsoftware.com/u/system)\
**Post date:** [August 17, 2019, 4:48am UTC](https://forums.realmacsoftware.com/t/current-date-in-form-field-html-troubles/27888/4 "2019-08-17T04:48:43Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
