You're using .NET properties and methods. Need to use the javascript
equivalents.
This works in IE and Mozilla
function ClearBox(){
lb = document.getElementById("ListBox1");
for(var i=lb.length-1; i >=0; i--)
lb.remove(i);
}
Highly recommend the Javascript Bible, invaluable tool for getting
through the idioscyncrancies of all the *&%&$ javascript DOMs...
http://www.amazon.com/exec/obidos/tg/detail/-/0764557432/qid=1118067061/sr=8-1/ref=pd_csp_1/102-1892347-9296165?v=glance&s=books&n=507846
On 6/5/05, P P <[EMAIL PROTECTED]> wrote:
> Hi All
>
> I'm facing this strange problem in Javascript +
> ASP.NET, can somebody please tell me why the RESET is
> not working using Javascript.
>
> Here is the function (2 versions) which I call from
> javascript; I wanted the code to delete all the items
> from the list-box "lbAmenitiesSelected", but it does
> nothing, neither does it report any error.
>
> Code-1
> ======
> function ResetDropDowns_EstateInfo()
> {
> document.frmEstateInfo.lbAmenitiesSelected.Items.Clear();
>
> }
>
>
> Code-2
> ======
> function ResetDropDowns_EstateInfo()
> {
> for (h =
> document.frmEstateInfo.lbAmenitiesSelected.Items.Count-1;
> h >= 0; h--)
> {
>
> //document.frmEstateInfo.lbAmenitiesSelected.Items.RemoveAt(h);
>
> //document.frmEstateInfo.lbAmenitiesSelected.Items.removeItemAt(h);
>
> //document.frmEstateInfo.lbAmenitiesSelected.Items.removeItemFromSelection
> (h);
>
> document.frmEstateInfo.lbAmenitiesSelected.deleteItem(h);
> }
> }
>
>
> Thanks in advance
> PP
>
>
>
> __________________________________
> Discover Yahoo!
> Get on-the-go sports scores, stock quotes, news and more. Check it out!
> http://discover.yahoo.com/mobile.html
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/