1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Rep Power

    form problem - reset select forms when one is selected...

    hi all,

    i have been browsing several javascript sites for the past few hours! and i couldn't find a solution.

    i have a form with different select fields.
    these are all dynamicaly generated from a mysql db.

    There are two problems:

    First: these select fields contain up to three different types of information.

    - size
    - color
    - accessoires

    However there are DIFFERENT kinds of sizes.
    Size Range A
    Size Range B
    Size Range C

    each range contains various numbers.

    let's assume we have 3 select fields on our page.

    one with color options.
    two with size ranges.

    whenever you select something from one sizerange, the other sizerange must reset to default!

    I would do this with an "onChange" event handler, but...

    and here comes problem number two!

    the select fields look like this:

    <select name ="id[]">
    <option value="" SELECTED>Choose:</option>
    <option value="{3}10">58</option>
    <option value="{3}11">60</option>
    <option value="{3}12">62</option>
    <option value="{3}13">64</option>
    <option value="{3}14">66</option>
    <option value="{3}15">68</option>
    <option value="{3}16">70</option>
    as you can see the select field has no special name! all have the name "id[]".
    this cannot be changed. i need this name for the shop system which is using this template.

    so even if i had a script which would reset the other select field, i would have no possibility to define WHICH is the select field to reset! since all names are equal.

    BESIDES: I generate the select fields from a php script! So all ADDITIONAL info beside "name" in the select tag is possible.

    i hope i describes this mess in an understandable manner! my mind is a mess... been thinking about this for hours...


  2. #2
  3. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Sacramento, CA
    Rep Power
    Wrong forum. You want the JAVASCRIPT forum, not the JAVA forum. Happens all the time...

IMN logo majestic logo threadwatch logo seochat tools logo