unemployment Posted June 27, 2011 Share Posted June 27, 2011 I am trying to disable the user from being able to go to a new line in my text area. Why doesn't return false work? if (is_key(event, 13) && (with_field.value.length > 1)){ var search_list_ele_array = new Array(); var search_list_ele_array = document.getElementById('with_auto').getElementsByTagName('li'); for (j=0; j<search_list_ele_array.length; j++) { if ((search_list_ele_array[j].className == 'user list_hover') || (search_list_ele_array[j].className == 'comp list_hover') || (search_list_ele_array[j].className == 'blog list_hover')){ var link = search_list_ele_array[j].getElementsByTagName('a'); user_add(link[0], search); } } return false; } Quote Link to comment https://forums.phpfreaks.com/topic/240521-why-wont-return-false-disable-enter/ Share on other sites More sharing options...
Adam Posted June 28, 2011 Share Posted June 28, 2011 What event are you using to trigger the function? In which browser (or all of them) down it not work? What's the code behind "is_key()"? Quote Link to comment https://forums.phpfreaks.com/topic/240521-why-wont-return-false-disable-enter/#findComment-1235792 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.