Stop Enters
Posted: Mon Jun 27, 2011 5:43 pm
I have a textarea and I need to stop the line breaks from happening when enter is pressed. 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; }