Clear list box
Posted: Tue Apr 17, 2007 11:15 am
Hello
I am a newbie to PHP. I was designing a webpage. The page has a list box. I named the listbox list1[] so that I can handle the selected items as an array in PHP. But I have a clear button in the form to clear the contents of the all the text boxes, list boxes and check boxes in the form. I used javascript to clear the contents. When I use "[]" with the listbox name, I am not able to clear the contents of the listbox in javascript. Is there a way by which the list box can be cleared with javascript without affecting the php code much?
Thanks in advance.
I am a newbie to PHP. I was designing a webpage. The page has a list box. I named the listbox list1[] so that I can handle the selected items as an array in PHP. But I have a clear button in the form to clear the contents of the all the text boxes, list boxes and check boxes in the form. I used javascript to clear the contents. When I use "[]" with the listbox name, I am not able to clear the contents of the listbox in javascript. Is there a way by which the list box can be cleared with javascript without affecting the php code much?
Thanks in advance.