Results 1 to 5 of 5

Thread: Dynamically Add Textfield

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2003
    Posts
    14

    Dynamically Add Textfield

    Can someone post some code to dynamically add/remove a textfield by a button next to it.

    Ihave tried but for some reason it does not post to the email when used in an asp email application

  2. #2
    Member
    Join Date
    Jun 2004
    Location
    Texas
    Posts
    32
    How about something like this?

    ****************************************************
    <html>
    <head>
    <script language="VBScript">
    Sub Hide
    Dim MyForm
    Set MyForm = document.form1
    If (MyForm.textbx.style.display="none")Then
    MyForm.textbx.style.display="inline"
    Else
    MyForm.textbx.style.display="none"
    End If
    End Sub
    </script>
    </head>

    <body>
    <form name="form1">
    <input type="text" name="textbx">
    <button name="Visible" onClick="Hide">Visible?</button>
    </form>
    </body>
    </html>

  3. #3
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: Dynamically Add Textfield

    Originally posted by Mindbounce
    Can someone post some code to dynamically add/remove a textfield by a button next to it.

    Ihave tried but for some reason it does not post to the email when used in an asp email application
    In Client Side?

    Also explain what you are trying to do then we will be able to advice better.

    japshire, he wants to Create/Remove text field, also VBScript in client side should be avoided, as it only works in IE.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  4. #4

    Thread Starter
    New Member
    Join Date
    May 2003
    Posts
    14
    Well I have this form that has many input fields per item. Each Item they have to specify the size in this field. Sometimes they dont need these items but sometimes they need more fields to one item so therefore they need to add another field.

    Does that make sense.
    Let me know

  5. #5
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    Originally posted by Mindbounce
    Well I have this form that has many input fields per item. Each Item they have to specify the size in this field. Sometimes they dont need these items but sometimes they need more fields to one item so therefore they need to add another field.

    Does that make sense.
    Let me know
    My question was whether you are trying to do this in Client Side (e.g Using JavaScript or Server Side using ASP)?

    Anyhow if you are doing it in server side it should be quite simile. Just use if statement to figure when you need those extra field and just use response.write "<input type=textbox>" inside a loop.

    Doing this in client side might be a little bit harder.

    Hope this helps.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

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