Backspace event on form input

Hi guys,

i’m using this code to filter a dataview set of results based on what the user types into a search box

			var inputObj = crewSearchForm.getInput("searchname");
			inputObj.onkeypress = function(e){			
				(e||event).cancelBubble=true;
				window.setTimeout(function(){
					crewListDS.filter(function(obj,value){
						if (obj.crewname.toLowerCase().search(value.toLowerCase())!=-1) return true;
						return false;
					},inputObj.value);
				},1);
				return true;
			}

This works fine, however if the user presses backspace (delete) the event onkeypress isn’t being fired so the dataview isn’t updating… how do i trap a backspace kepress?

thanks

Unfortunately we cannot reproduce this issue locally. Can you please provide complete demo where we can reproduce it? You can find tutorial how to create complete demo here docs.dhtmlx.com/doku.php?id=othe … leted_demo

I changed to use onkeydown instead of onkeypress and this seems to have resolved it!

thanks!