How to implement two drop-down list dependency in ASP/HTML/VBscript forms?

Discussion in 'HTML' started by srini, Apr 14, 2004.

  1. srini

    srini Guest

    Hi All,

    I have an html form, C:\srini.html and it has two drop-down lists
    (FieldA and FieldB) and one text field, Summary and then Submit and
    Cancel buttons.

    First when you click on FieldB, you should not see any drop down
    entrees there. FieldA has two entrees (Test1 and Test2). When you
    click on Test1 value in the FieldA drop-down list, it should show me
    dynmically three values in the FieldB drop-down list (Apple, Banana,
    and Mango). Again, when I click on Test value in the FieldA drop-down
    list, it should show me dynmically anoher five values in the FieldB
    drop-down list (San Jose, Fremont, Newark, Hayward, and Concord).

    How can I implement this kind of dynamic intra-field dependency (only
    from FieldA to FieldB) on the html form? I know that I should use some
    asp script as well apart from srini.html.

    Can some one guide me step by step with some appropriate code?

    Thansk in advance,
    Srini
     
    srini, Apr 14, 2004
    #1
    1. Advertising

  2. srini

    Whitecrest Guest

    In article <>, schimata2
    @yahoo.com says...
    > Hi All,
    > First when you click on FieldB, you should not see any drop down
    > entrees there. FieldA has two entrees (Test1 and Test2). When you
    > click on Test1 value in the FieldA drop-down list, it should show me
    > dynmically three values in the FieldB drop-down list (Apple, Banana,
    > and Mango)....


    here are a few ways, there are others....

    Use javascript (not viewable by all)

    Use .net It can make a round trip to he server without refreshing the
    page.
    --
    Whitecrest Entertainment
    www.whitecrestent.com
     
    Whitecrest, Apr 14, 2004
    #2
    1. Advertising

  3. srini wrote:

    > Can some one guide me step by step with some appropriate code?


    Example:
    http://www.goddamn.co.uk/tobyink/scratch/choosestuff

    Source code:
    http://www.goddamn.co.uk/tobyink/scratch/choosestuff-src

    I've commented it pretty thoroughly.

    This uses PHP rather than ASP, though it should give you an idea of the
    basic principles involved. Once you have that, it should be pretty easy to
    rewrite in ASP.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
     
    Toby A Inkster, Apr 14, 2004
    #3
  4. srini

    Richard Guest

    srini wrote:

    > Hi All,


    > I have an html form, C:\srini.html and it has two drop-down lists
    > (FieldA and FieldB) and one text field, Summary and then Submit and
    > Cancel buttons.


    > First when you click on FieldB, you should not see any drop down
    > entrees there. FieldA has two entrees (Test1 and Test2). When you
    > click on Test1 value in the FieldA drop-down list, it should show me
    > dynmically three values in the FieldB drop-down list (Apple, Banana,
    > and Mango). Again, when I click on Test value in the FieldA drop-down
    > list, it should show me dynmically anoher five values in the FieldB
    > drop-down list (San Jose, Fremont, Newark, Hayward, and Concord).


    > How can I implement this kind of dynamic intra-field dependency (only
    > from FieldA to FieldB) on the html form? I know that I should use some
    > asp script as well apart from srini.html.


    > Can some one guide me step by step with some appropriate code?


    > Thansk in advance,
    > Srini


    http://us.creative.com/support/downloads/

    This working model does what you want using javascript.

    You might want to look for something similar using cgi.
     
    Richard, Apr 14, 2004
    #4
  5. srini

    mscir Guest

    mscir, Apr 14, 2004
    #5
  6. srini

    mscir Guest

    Re: How to implement two drop-down list dependency in ASP/HTML/VBscriptforms?

    mscir wrote:
    > srini wrote:
    >> How can I implement this kind of dynamic intra-field dependency (only
    >> from FieldA to FieldB) on the html form?

    >
    > http://www.roubaixinteractive.com/PlayGround/JavaScript/Dependent_List_Box.asp


    And a few more, the first one's very straightforward javascript:

    http://www.tneoh.zoneit.com/javascript/dynalistbox.txt
    http://www.mattkruse.com/javascript/dynamicoptionlist/
    http://www.4guysfromrolla.com/webtech/101099-1.shtml

    asp:
    http://www.aspin.com/home/tutorial/formproc/listboxe

    Mike
     
    mscir, Apr 14, 2004
    #6
  7. srini

    srini Guest

    Thanks to all of you, folks!!!

    Srini

    (srini) wrote in message news:<>...
    > Hi All,
    >
    > I have an html form, C:\srini.html and it has two drop-down lists
    > (FieldA and FieldB) and one text field, Summary and then Submit and
    > Cancel buttons.
    >
    > First when you click on FieldB, you should not see any drop down
    > entrees there. FieldA has two entrees (Test1 and Test2). When you
    > click on Test1 value in the FieldA drop-down list, it should show me
    > dynmically three values in the FieldB drop-down list (Apple, Banana,
    > and Mango). Again, when I click on Test value in the FieldA drop-down
    > list, it should show me dynmically anoher five values in the FieldB
    > drop-down list (San Jose, Fremont, Newark, Hayward, and Concord).
    >
    > How can I implement this kind of dynamic intra-field dependency (only
    > from FieldA to FieldB) on the html form? I know that I should use some
    > asp script as well apart from srini.html.
    >
    > Can some one guide me step by step with some appropriate code?
    >
    > Thansk in advance,
    > Srini
     
    srini, Apr 14, 2004
    #7
  8. srini

    praveen synergy

    Joined:
    Aug 30, 2010
    Messages:
    1
    Text box dependency

    Hi All,
    We have three text boxes, those all are depending on first text box, if we entered 999 in first text box remaining text boxes must be null (no alerts, not mandatory). If we entered other than 999 (means less than 999) then we must and should enter remaining two text boxes (mandatory). How can we go. please provide us example html code with java script. Helping will be really appreciated.

    Thanks
     
    praveen synergy, Aug 30, 2010
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SirPoonga
    Replies:
    2
    Views:
    799
    Ben Strackany
    Jan 7, 2005
  2. weiwei
    Replies:
    0
    Views:
    1,047
    weiwei
    Jan 5, 2007
  3. msimmons
    Replies:
    0
    Views:
    514
    msimmons
    Jul 16, 2009
  4. Replies:
    5
    Views:
    295
  5. Replies:
    3
    Views:
    312
Loading...

Share This Page