Results 1 to 3 of 3

Thread: Adding controls at runtime VBScript?

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    48

    Question

    hi all,

    I have this on vb app, and it works fine, it creates however many textboxes depending on the input (GuestNum). It uses index, btw.

    Public Sub ShowGuestBoxes()

    For Counter = 1 To (frmOpening.GuestNum - 1) Step 1
    Load txtGuestEat(Counter)
    txtGuestEat(Counter).Visible = True
    Next Counter

    End Sub

    Now how do I do this in VbScript/ASP?

    On my asp page, I am receiving GuestNum using Request Form, then I want to create those textboxes on the page.

    I tried the same method as in VB App, but keep getting errors. Any ideas? Thanks a lot.

    Martin

  2. #2

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    48

    More

    This is what's in my ASP file:

    ------------------------------
    <%@ LANGUAGE="VBScript" %>
    <html>

    <head>
    <title></title>
    </head>

    <body>

    <form NAME="frmBoxes">
    <table>
    <tr>
    <td><b>Guest Eats:</b></td>
    <td><input TYPE="text" NAME="txtGuestEat" SIZE="15"> </td>
    </tr>
    <tr>
    <td><table>
    </table>
    </td>
    </tr>
    </table>
    </form>

    <%
    Dim GuestNum

    GuestNum = Request.Form("txtGuestNum")

    For Counter = 1 to GuestNum
    Load txtGuestEat(Counter)
    Next Counter

    %>

    </body>
    </html>
    ------------------------------

    I keep getting errors such as Object Required, I tried putting Document.frmBoxes.txtGuestEat(Counter) and it doesn't work. Is this even possible?

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    48

    Talking NEVER MIND

    Never mind, I got it. Heheheeh.

    Silly me, it took me so long to realize that Response.Write is just like writing html code. SLICK!!!

    Thanks anyway.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width