tjburdette Posted August 20, 2012 Share Posted August 20, 2012 I have a script at my work that I'm using to display the facility safety acknowledgements. I'm displaying how many days it's been since a first aid event, a recordable, disabling, etc.... I have it all working and displaying to little smart monitors out front. It is working. So my question is how can I build a form to update it when something does happen? I have to manually update it right now through the code but the HR ladies up front won't be able to do that. Here is the code for one of the images that I'm displaying. All I need is a form that will connect to this document basically. <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Pendleton Finishing Plant - First Aid Days</title> <style type="text/css"> /* pendleton finishing circle image */ #imgFirstaid { position: absolute; top: 10px; left: 110px; z-index: 0; } /* large xx of days in the center of the circle */ #strFirstaid{ width: 579px; height: 579px; text-align: center; margin-top: 125px; position: absolute; top: 25px; left: 115px; z-index: 0; font-family: calibri; font-weight: bold; font-size: 250px; color: #403152; } /* small date at the bottom of the circle */ #txtFirstaid{ width: 579px; height: 579px; text-align: center; margin-top: 365px; position: absolute; top: 25px; left: 115px; z-index: 0; font-family: calibri; font-size: 28px; color: #403152; } </style> <script> function GetFirstaid(){ var then = new Date(2012, 7, 16), // month is zero based, i.e. jan = 0 now = new Date; // no arguments -> current date // 24 hours, 60 minutes, 60 seconds, 1000 milliseconds out=Math.abs((now - then) / (1000 * 60 * 60 * 24)); // round the amount of days rou=Math.round(out) document.getElementById('strFirstaid').innerHTML=rou; } window.onload=function(){GetFirstaid();}//call when everything has loaded </script> </head> <body> <div id="imgFirstaid"><img src="../images/lg-f.png" /></div> <div id="strFirstaid"></div> <div id="txtFirstaid">_____________________ <br />8/16/2012</div> <!-- enter the date as normal --> </body></html> Link to comment Share on other sites More sharing options...
niche Posted August 20, 2012 Share Posted August 20, 2012 (edited) You're using a div tag when you probably want a form tag. http://www.w3schools.com/html/html_forms.asp Edited August 20, 2012 by niche Link to comment Share on other sites More sharing options...
thescientist Posted August 20, 2012 Share Posted August 20, 2012 In order for something to automatically update, you would need to have the information in question in a place of persistent storage (like a DB). The page to display this information would always look to the DB to display. From there, you can either manually update the DB yourself, or write a form that submits to a script that does the DB updating for you. Link to comment Share on other sites More sharing options...
niche Posted August 20, 2012 Share Posted August 20, 2012 That's more or less what we said last time: http://w3schools.invisionzone.com/index.php?showtopic=44686 Link to comment Share on other sites More sharing options...
davej Posted August 21, 2012 Share Posted August 21, 2012 I'm displaying how many days it's been since a first aid event, a recordable, disabling, etc.[...] I have it all working and displaying to little smart monitors out front. Little smart monitors? What are you talking about? Is this a website or not? Link to comment Share on other sites More sharing options...
tjburdette Posted August 24, 2012 Author Share Posted August 24, 2012 It already works as it is. Currently there is no form to make it user friendly. I did succeed in building the same thing in access but it doesn't have to farmatting propertied that I need here. I just need a form that will update the information that's all. Here is a screenshot of one of the outputs. Like I said this already works right now. It's just that when something does happen and the date needs updating, I have to do it in the code and I want a form to do it for me. That way I can let the hr people do it themselves. Link to comment Share on other sites More sharing options...
tjburdette Posted August 24, 2012 Author Share Posted August 24, 2012 Sorry it didn't take my screenshot!!! Link to comment Share on other sites More sharing options...
tjburdette Posted August 24, 2012 Author Share Posted August 24, 2012 The monitor's are small 12" monitors with built in wifi that I use to access the network and run the script. Link to comment Share on other sites More sharing options...
Recommended Posts
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