heraldleader Posted August 19, 2011 Report Share Posted August 19, 2011 Hi all, I'm trying to automate a column in a table. The datapage is a web form that is keyed in by staffers. The date/time field is automatically recreated when they submit an entry. I'd like a new column to pull the year from that date field, also automatically, to save key strokes on deadline. Is there a way to do that? My head is unable to wrap around it this morning. page is at: http://www.kentucky.com/2009/08/19/9008 ... -line.html the year field works in 2008 and 2009, but not 2010. Linda J. Quote Link to comment Share on other sites More sharing options...
Aariel Posted August 19, 2011 Report Share Posted August 19, 2011 hi, As I understood, you have a table which has a date field. In the same table, now you want to create a new column which will save only year that is present in the existing date field. So, I thought I will see a submission form. The link you provided has a search form. Please explain if I missed something. Quote Link to comment Share on other sites More sharing options...
nkamalan Posted August 19, 2011 Report Share Posted August 19, 2011 Hello, You can try this Java Script in the footer of the submission page: function findY() { var myYear= document.getElementById("InsertRecordDATEFIELDNAME").value; document.getElementById("InsertRecordYEARFIELDNAME").value= myYear.substr(6,10); } document.getElementById("caspioform").onsubmit = findY; Replace field names with your own field name. Hope that helps. Regards, NKamalan Quote Link to comment Share on other sites More sharing options...
nkamalan Posted August 19, 2011 Report Share Posted August 19, 2011 Hi Linda, I just noticed that you have a date field that is automatically recreated when users submit an entry. Is a submission page or an update page? Is it a Timestamp field in the table? If yes, then you won't be able to use the JavaScript I provided. You can use this script when you have a date field in the form and user can select the date from pop calendar. Can you please explain what do you need the year for? And why do you need to have both year and date in the table? the reason I am asking is, maybe there is another easier way that you can create this app. If you can please elaborate more, I will be able to provide you with a better solution. Regards, NKalaman 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.
Note: Your post will require moderator approval before it will be visible.