How can I enter value based on Selected item

Discussion in 'ASP General' started by techy techno, Jan 27, 2004.

  1. techy techno

    techy techno Guest

    hii

    i created a form like this
    <html>
    <head>
    <title>ACCOUNT EXAMPLE</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body bgcolor="#FFFFFF" text="#000000">

    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <form name="form1" method="post" action="">
    <table width="821" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="239">
    <div align="center"><font size="2"><b>DATE :</b></font>
    <input type="text" name="txtDate">
    </div>
    </td>
    <td width="312"> <font size="2"><b>DETAILS :</b></font>
    <textarea name="txtDetails" rows="2" cols="30">SALARY PAID
    </textarea>
    </td>
    <td width="85">
    <div align="center">
    <select name="select">
    <option>DEBIT</option>
    <option>CREDIT</option>
    </select>
    </div>
    </td>
    <td width="102">
    <div align="left">
    <input type="text" name="txtAmount" value="RS 5000">
    </div>
    </td>
    <td width="11">
    <input type="submit" name="Submit" value="INSERT">
    </td>
    </tr>
    </table>
    </form>
    <p>&nbsp;</p>
    </body>
    </html>


    when the user selects debit I want the amount to go into the debit field
    of the accounts table and when he users selects credit it should go into
    the credit field(colum) of the accounts table

    how can I do this in ULTRADEV or UD

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    techy techno, Jan 27, 2004
    #1
    1. Advertising

  2. techy techno

    Ray at Guest

    What table are you talking about? In a database? If so, you'll use a
    if-then, or a select-case, like so:


    Dim sType
    sType = Request.Form("YouNeedToNameYourSELECTandPutTheNameHere")
    'You also need to give values to the options

    Select Case sType
    Case "CREDIT"
    sSQL = "your appropriate sql string"
    Case "DEBIT"
    sSQL = "your appropriate sql string"
    End Select

    Ray at home

    "techy techno" <> wrote in message
    news:%...
    >
    >
    > hii
    >


    >
    >
    > when the user selects debit I want the amount to go into the debit field
    > of the accounts table and when he users selects credit it should go into
    > the credit field(colum) of the accounts table
    >
    > how can I do this in ULTRADEV or UD
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    Ray at, Jan 27, 2004
    #2
    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. Iain
    Replies:
    3
    Views:
    919
  2. mldardy
    Replies:
    0
    Views:
    953
    mldardy
    Sep 28, 2010
  3. QUASAR
    Replies:
    6
    Views:
    408
    QUASAR
    Jan 17, 2004
  4. Tom Jenkins
    Replies:
    10
    Views:
    181
    Thomas 'PointedEars' Lahn
    Oct 10, 2004
  5. HopfZ
    Replies:
    0
    Views:
    540
    HopfZ
    Aug 28, 2006
Loading...

Share This Page