Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 javascript question
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

redbrad0
Advanced Member

USA
3725 Posts

Posted - 30 October 2001 :  18:53:39  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
can someone please tell me what the javacript on the page is not selecting the entire list? It always leaves out the very last item.

here is where the test file is located at...

http://www.freeaspcode.net/test.html

Brad

Aznknight
Senior Member

USA
1373 Posts

Posted - 30 October 2001 :  19:38:53  Show Profile  Send Aznknight an AOL message  Send Aznknight an ICQ Message
sure brad,

Seems like your collection indexes are off. Also I don't see why you would need the two if's statements. Just use the for loop is fine. like this:



<form name="PostCat" action="" method="post">
<SCRIPT language=JavaScript>
function selectUsers(from)
{
for (x = 0;x < from.length;x++)
from.options[x].selected = true;
}
</SCRIPT>


<SELECT multiple size=10 name=AuthUsers>
<OPTION value=1>Test 1</OPTION>
<OPTION value=2>Test 2</OPTION>
<OPTION value=3>Test 3</OPTION>
<OPTION value=4>Test 4</OPTION>
</SELECT>
<p><INPUT onclick=selectUsers(document.PostCat.AuthUsers) type=button value="Edit" name=SubmitButton>
</form>


- Alan
www.iamviet.com
Snitz Resource
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 30 October 2001 :  19:52:57  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
thanks alan, it worked like a CHARM

Brad
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.2 seconds. Powered By: Snitz Forums 2000 Version 3.4.07