toolman Posted June 26, 2015 Share Posted June 26, 2015 Hi, I have the following code which I would like to insert into a field/hidden field. var now = new Date(); now.setDate(now.getDate()); document.getElementById("s_creation_date").innerHTML = now; I have the following HTML: <input type="text" name="s_creation_date" id="s_creation_date" /> I tried using the getElementbyId, but it didn't work. Any ideas? Thanks! Quote Link to comment Share on other sites More sharing options...
fastsol Posted June 26, 2015 Share Posted June 26, 2015 Try document.getElementById("s_creation_date").value = now; Quote Link to comment Share on other sites More sharing options...
toolman Posted June 26, 2015 Author Share Posted June 26, 2015 Many thanks, it worked! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.