#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    St. Petersburg, FL
    Posts
    21
    Rep Power
    0
    Is the a good example of how to evaluate a multi select list box array - I'm missing a basic reference to the elements and to the sizeof(array)

    thanks

    Bill
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    yea,


    I'm missing a basic reference to the elements and to the sizeof(array)

    you can use count() function for that.

    here is an example..


    <?

    for($a=0;$a<count($your_array[]);$a++){
    echo "Selected values are:".$your_array[$a];
    }

    ?>

    Good Luck!!


    ------------------
    SR -
    webshiju.com

    "The fear of the LORD is the beginning of knowledge..."
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    St. Petersburg, FL
    Posts
    21
    Rep Power
    0
    I'm missing something more fundemental -

    If I have a multi select ListBox with an number of elements selected I would think that I could traverse the elements like in VB

    for i = 1 to len(listbox)
    ?listbox[i].list
    next

    I might have the list box set up incorrectly
    as there is no reference to any key exap:


    <p>Do you have access to any of the following: <select size="12" name="D13" multiple>
    <option>computers</option>
    <option>Internet</option>
    <option>Intranet</option>
    <option>libraries</option>
    <option>electronic libraries</option>


    But I saw this in a sample last week and now don't remember where I saw the code.

    Thanks,

    Bill
  6. #4
  7. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    <<
    <p>Do you have access to any of the following: <select size="12" name="D13" multiple>
    <option>computers</option>
    <option>Internet</option>
    <option>Intranet</option>
    <option>libraries</option>
    <option>electronic libraries</option>
    >>



    Your select box should be an array..

    <select size="12" name="D13[]" multiple>
    <option value="computers">computers</option>
    <option value="Internet">Internet</option>
    </select>


    for i = 1 to len(listbox)
    ?listbox[i].list
    next


    The following script will do same action..

    <?

    for($a=0;$a<count(D13[]);$a++){
    echo "Selected values are:".D13[$a];
    }
    ?>




    ------------------
    SR -
    webshiju.com

    "The fear of the LORD is the beginning of knowledge..."
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    St. Petersburg, FL
    Posts
    21
    Rep Power
    0
    Bingo -


    for($a=0; $a<count($D13); $a++){
    echo ("Selected values are:".$D13[$a]."<BR>") ;
    }

    thanks

    suffering from brain freeze

Similar Threads

  1. Drop down list box
    By rbe in forum HTML Programming
    Replies: 1
    Last Post: February 9th, 2004, 04:28 PM
  2. Using an array to fill an HTML table
    By kjzoo in forum HTML Programming
    Replies: 0
    Last Post: January 27th, 2004, 12:17 PM
  3. How to get client email??Help plz
    By Gecko22 in forum ASP Programming
    Replies: 12
    Last Post: January 22nd, 2004, 02:40 PM
  4. not returning records when it should
    By aliaga61 in forum ASP Programming
    Replies: 3
    Last Post: January 16th, 2004, 11:57 AM
  5. 'Object required' error
    By aliaga61 in forum ASP Programming
    Replies: 1
    Last Post: January 16th, 2004, 09:48 AM

IMN logo majestic logo threadwatch logo seochat tools logo