Form change based upon criteria selected?

Discussion in 'ASP General' started by Micromanaged, Jul 2, 2004.

  1. Micromanaged

    Micromanaged Guest

    Is it possible (and if so, how?) to have an asp form page that based
    upon a user's selection on a field, would generate a input field b that
    the user selects?

    For example:

    User selects "name" in a select statement which would list the possible
    names to select from or if the user selects "telephone" in the same
    select statement then it would list the possible telephone numbers to
    select from.

    Or simpler:

    If user selects A then show P to select from or
    if user selects B then show Z to select from.

    Thanks in advance


    *** Sent via Devdex http://www.devdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Micromanaged, Jul 2, 2004
    #1
    1. Advertising

  2. Micromanaged

    Steven Burn Guest

    You'd need to either;

    1. Use If/Then or Select Case, combined with a querystring
    2. Use client side code

    For the latter, you'd need to post to a client side group, such as;

    microsoft.public.scripting.jscript

    --

    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!


    "Micromanaged" <> wrote in message
    news:...
    >
    >
    > Is it possible (and if so, how?) to have an asp form page that based
    > upon a user's selection on a field, would generate a input field b that
    > the user selects?
    >
    > For example:
    >
    > User selects "name" in a select statement which would list the possible
    > names to select from or if the user selects "telephone" in the same
    > select statement then it would list the possible telephone numbers to
    > select from.
    >
    > Or simpler:
    >
    > If user selects A then show P to select from or
    > if user selects B then show Z to select from.
    >
    > Thanks in advance
    >
    >
    > *** Sent via Devdex http://www.devdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Steven Burn, Jul 2, 2004
    #2
    1. Advertising

  3. Micromanaged

    Micromanaged Guest

    I tried using If..Then, but I couldn't get it to work. Once I select a
    value in the first field, does the fieldname receive that value as soon
    as I select it, or is it still null until I hit the submit button on the
    form?


    *** Sent via Devdex http://www.devdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Micromanaged, Jul 2, 2004
    #3
  4. Micromanaged

    Bullschmidt Guest

    Here's something I put together about having pages post back to
    themselves that hopefully might give you some ideas.

    ASP Design Tips - Post Back Page
    http://www.bullschmidt.com/devtip-postbackpage.asp

    Perhaps have most Web pages "post back" to themselves and then handle
    further processing from there. This can often cut down on the number of
    pages that need to be developed and the related back-and-forth involved
    with many pages.

    To make the form post back to the same page:
    <form id="frmMain" name="frmMain" action="<%=
    Request.ServerVariables("SCRIPT_NAME") %>" method="post">

    And here are some buttons:
    <% ' *** btnClose %>
    <input type="submit" name="btnClose" value="Close">
    <% ' *** btnSave %>
    <input type="submit" name="btnSave" value="Save">
    <% ' *** btnNew %>
    <input type="submit" name="btnNew" value="New">
    <% ' *** btnDel %>
    <input type="submit" name="btnDel" value="Delete" onclick="return
    confirm('Are you sure you want to delete this record?');">

    To handle processing toward the top of the page:
    If Request.Form("btnClose") <> "" Then ' Close btn.
    ' Close.
    Call ClosePg()
    Elseif Request.Form("btnSave") <> "" Then ' Save btn.
    ' Set var.
    Call SetVar("frompost")

    ' Save rec.
    Call SaveRec()
    Elseif Request.Form("btnNew") <> "" Then ' New btn from this pg.
    ' Set var.
    Call SetVar("new")
    Elseif Request.Form("btnDel") <> "" Then ' Del btn.
    ' Set var.
    Call SetVar("frompost")

    ' Del rec.
    Call DelRec()

    ' Set var.
    Call SetVar("new")
    Elseif Request.QueryString("CustID") <> "" Then ' CustID from Many pg.
    ' Set var.
    Call SetVar("fromdb")
    Elseif Request.QueryString("CustID") = "" Then ' Add btn from MainMenu
    pg.
    ' Set var.
    Call SetVar("new")
    End If

    And the ClosePg(), DelRec(), SaveRec(), and SetVar() functions above are
    custom functions that would still need to be developed.

    Best regards,
    J. Paul Schmidt, Freelance ASP Web Designer
    http://www.Bullschmidt.com
    ASP Designer Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


    *** Sent via Devdex http://www.devdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Bullschmidt, Jul 5, 2004
    #4
    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. dbuchanan
    Replies:
    2
    Views:
    2,625
    dbuchanan
    Dec 19, 2005
  2. SA SA
    Replies:
    5
    Views:
    2,502
    Ray Costanzo [MVP]
    Oct 19, 2006
  3. Replies:
    7
    Views:
    267
  4. RCGUA
    Replies:
    0
    Views:
    214
    RCGUA
    Oct 2, 2009
  5. RCGUA
    Replies:
    6
    Views:
    667
    Thomas 'PointedEars' Lahn
    Oct 3, 2009
Loading...

Share This Page