Eiolon Posted October 31, 2007 Share Posted October 31, 2007 I currently use a date/time chooser that was made in javascript. The user clicks on the picture of a calendar and selects the date and time. It then puts the data into the text field of the form. My question, is there a way to disable the text field so the user HAS to use the date/time chooser to enter the data into the field? It's very important that the datetime format is kept so I don't want them entering it in their own format. Thanks! Quote Link to comment Share on other sites More sharing options...
mainewoods Posted October 31, 2007 Share Posted October 31, 2007 --change the field that displays the date/time to READONLY in the html, if it doesn't have it, add an 'id=' to that field also find the place in the javascript where the date/time is moved to that field. add a line before it and a line after it: document.getElementById('datetimefieldID').readOnly = false; //modifiable now //the statement that assigns the date/time to the field is here document.getElementById('datetimefieldID').readOnly = true; //protected against the user again Quote Link to comment Share on other sites More sharing options...
Eiolon Posted October 31, 2007 Author Share Posted October 31, 2007 Thanks, works like a charm 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.