fry2010 Posted May 17, 2009 Share Posted May 17, 2009 Hi does anyone know how you can recognise whether a user has used autofill on a form? At the moment when a user fills my form out I can recognise when they type and also copy and paste. But when I do an auto fill i.e. you select the input box then a drop down menu appears showing what you usually put into a box, and when I click it my check_process() doesnt recognise anything has been put in until the user types again. I am already checking how many characters have been entered and whether it is valid, this is all working, its just when an auto fill has been done. Any ideas? I thought about doing it through an onclick event, but there might be a better way. Quote Link to comment Share on other sites More sharing options...
fry2010 Posted May 17, 2009 Author Share Posted May 17, 2009 At the moment I have got it working with onmouseover. But the trouble is everytime the user moves the mouse over the form the function is repeatadly called, which may cause things to slow down. Im not sure. Is constantly calling a function to process a bad thing? The other way of onclick or onfocus etc is that it will only analyse the data once the user has done another event after they already entered the data. I need it to work straight away after the intial event of auto filling. Mouseover seems to do the trick nicely though.. Quote Link to comment Share on other sites More sharing options...
Axeia Posted May 17, 2009 Share Posted May 17, 2009 Quite sure mouseover is only fired when the cursor is moved from somewhere else onto the element.. how about keyboard navigation though? If you really need it that bad you could let a timer run checking the value every 0.x sec once the field is focussed, and kill the timer onblur. There's also the possibility of adding the attribute autocomplete="off" It will cause your page not to validate.. but since it's used to 'fight' something added by javascript you might want to add the fix via javascript as well, document.GetElementById( 'id' ).setAttribute( 'autocomplete', 'off' ); Quote Link to comment Share on other sites More sharing options...
fry2010 Posted May 17, 2009 Author Share Posted May 17, 2009 well it appears to be working , I think u r right about it needs to move onto the element from something else. But basically javascript events are not recognised when you click the auto-fill box that comes up, if u know the type I mean. So its going from off the 'document' when you click or hover over the autofill box, then to the 'document' once u click it or click off it, so the mouseover state is recognised everytime an autofill is done. Thanks for your suggestions aswell, i was considering setting a timeout event. 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.