pop up text area after click yes from drop down list

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default pop up text area after click yes from drop down list

    Hi all
    I want to write a asp script, basically, that has drop down box in the
    form, if user select Yes,
    on the same page, a hidden textarea will show up, if user select No,
    then nothing happen.
    so far, my code is unsuccessful, in addition, I also got syntax error
    on the response.write line
    anyone has idea, please help me out, I would really appreciate your
    help

    below is my current code


    <form name="form1" method="post" action="test13.asp">

    <select name="test">
    <option value=""></option>
    <option value="Yes">Yes</option>
    <option value="No">No</option>
    </select>

    <%strtest = request("test")%>
    <%
    If strtest = "Yes" Then
    response.write "<textarea name="whatis" cols="50"></textarea>"
    Else

    End if
    %>

    </form>
    weiwei Guest

  2. Similar Questions and Discussions

    1. Coursebuilder - 5 text areas for 5 possible scores. Eachpossible answer has its own text area
      I'm trying to build an inventory form that has different point values for each possible answer for a particular question. there will be 5 possible...
    2. play sound on any click in the movie area
      Is there a way to play a sound on any click in the movie area (other than making a giant invisible button)? Thanks.
    3. Dynamical populating a list that can be used as drop down list
      Hi, I have a solution in which a person can be a member of one or more groups. In this case the groups are those used in the protection schema of...
    4. Help- Click Drag and Drop games in director
      Hi I'm trying to do a very simple game. Drag and drop a letter to complete a word. I am a real novice and my coding is pretty bad. I have been...
    5. select from drop list to fill table column with text -- HOW ?
      I want viewers to compare state laws on a single subject. Imagine a three-column table with a drop-down box on the top. A viewer selects a state...
  3. #2

    Default Re: pop up text area after click yes from drop down list

    "weiwei" wrote:
    : Hi all
    : I want to write a asp script, basically, that has drop down box in the
    : form, if user select Yes,
    : on the same page, a hidden textarea will show up, if user select No,
    : then nothing happen.

    Can't do that. ASP server script has already processed and user input is
    now working with client script.

    : so far, my code is unsuccessful, in addition, I also got syntax error
    : on the response.write line
    : anyone has idea, please help me out, I would really appreciate your
    : help
    Correct. You're trying to reference elements that do not exist. The ASP
    processor only processes ASP code, not client-side script or HTML. It just
    passes those to the client. The browser is then required to process the
    code.

    : below is my current code
    :
    : <form name="form1" method="post" action="test13.asp">
    :
    : <select name="test">
    : <option value=""></option>
    : <option value="Yes">Yes</option>
    : <option value="No">No</option>
    : </select>
    :
    : <%strtest = request("test")%>
    request is actually Request.QueryString and it is looking for ?test=szValue

    : <%
    : If strtest = "Yes" Then
    : response.write "<textarea name="whatis" cols="50"></textarea>"
    : Else
    no else clause included to else not required

    : End if
    : %>
    : </form>

    To make this work, consider the following:

    <%@ Language=VBScript %>
    <HTML>
    <HEAD>
    <script type="text/javascript">
    function getState(x) {
    if(x == 1) {
    document.getElementById("ta1").style.display='bloc k';
    } else {
    document.getElementById("ta1").style.display='none ';
    }
    }
    </script>
    </HEAD>
    <BODY>
    <form name="form1">
    <select id="test" name="test" onchange="getState(this.selectedIndex)">
    <option value=""></option>
    <option value="Yes">Yes</option>
    <option value="No">No</option>
    </select>
    </form>
    <textarea id=ta1 rows=5 cols=40 style="display: none; overflow: auto">some
    text for filler</textarea>
    </BODY>
    </HTML>

    [url]http://kiddanger.com/lab/displayta.asp[/url]

    --
    Roland

    This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose.
    -Technet Knowledge Base-
    [url]http://support.microsoft.com/default.aspx?scid=fh;EN-US;kbhowto&sd=TECH&ln=EN-US&FR=0[/url]
    -Technet Script Center-
    [url]http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/default.asp[/url]
    -MSDN Library-
    [url]http://msdn.microsoft.com/library/default.asp[/url]


    Roland Hall Guest

  4. #3

    Default Re: pop up text area after click yes from drop down list

    Thats usefull Roland
    But how would you do it with a checkbox as it does not have a selected
    index.

    Many Regards
    Don




    "Roland Hall" <nobody@nowhere> wrote in message
    news:%235mZHiK1DHA.2324@TK2MSFTNGP09.phx.gbl...
    > "weiwei" wrote:
    > : Hi all
    > : I want to write a asp script, basically, that has drop down box in the
    > : form, if user select Yes,
    > : on the same page, a hidden textarea will show up, if user select No,
    > : then nothing happen.
    >
    > Can't do that. ASP server script has already processed and user input is
    > now working with client script.
    >
    > : so far, my code is unsuccessful, in addition, I also got syntax error
    > : on the response.write line
    > : anyone has idea, please help me out, I would really appreciate your
    > : help
    > Correct. You're trying to reference elements that do not exist. The ASP
    > processor only processes ASP code, not client-side script or HTML. It
    just
    > passes those to the client. The browser is then required to process the
    > code.
    >
    > : below is my current code
    > :
    > : <form name="form1" method="post" action="test13.asp">
    > :
    > : <select name="test">
    > : <option value=""></option>
    > : <option value="Yes">Yes</option>
    > : <option value="No">No</option>
    > : </select>
    > :
    > : <%strtest = request("test")%>
    > request is actually Request.QueryString and it is looking for
    ?test=szValue
    >
    > : <%
    > : If strtest = "Yes" Then
    > : response.write "<textarea name="whatis" cols="50"></textarea>"
    > : Else
    > no else clause included to else not required
    >
    > : End if
    > : %>
    > : </form>
    >
    > To make this work, consider the following:
    >
    > <%@ Language=VBScript %>
    > <HTML>
    > <HEAD>
    > <script type="text/javascript">
    > function getState(x) {
    > if(x == 1) {
    > document.getElementById("ta1").style.display='bloc k';
    > } else {
    > document.getElementById("ta1").style.display='none ';
    > }
    > }
    > </script>
    > </HEAD>
    > <BODY>
    > <form name="form1">
    > <select id="test" name="test" onchange="getState(this.selectedIndex)">
    > <option value=""></option>
    > <option value="Yes">Yes</option>
    > <option value="No">No</option>
    > </select>
    > </form>
    > <textarea id=ta1 rows=5 cols=40 style="display: none; overflow: auto">some
    > text for filler</textarea>
    > </BODY>
    > </HTML>
    >
    > [url]http://kiddanger.com/lab/displayta.asp[/url]
    >
    > --
    > Roland
    >
    > This information is distributed in the hope that it will be useful, but
    > without any warranty; without even the implied warranty of merchantability
    > or fitness for a particular purpose.
    > -Technet Knowledge Base-
    >
    [url]http://support.microsoft.com/default.aspx?scid=fh;EN-US;kbhowto&sd=TECH&ln=EN-US&FR=0[/url]
    > -Technet Script Center-
    >
    [url]http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/default.asp[/url]
    > -MSDN Library-
    > [url]http://msdn.microsoft.com/library/default.asp[/url]
    >
    >

    Don Grover Guest

  5. #4

    Default Re: pop up text area after click yes from drop down list

    This is exactly what I need , can you post the source for this.
    Wome of my client forms are getting overly long with all the comment data
    they have to put in.

    Thanks, where would we be without you guys who give their time to us less
    experienced.
    Many Thanks
    Don
    > However, you could do it with two checkboxes.
    > [url]http://kiddanger.com/lab/displayta2.asp[/url]
    >

    Don Grover Guest

  6. #5

    Default Re: pop up text area after click yes from drop down list

    "Don Grover" wrote:
    : Thats usefull Roland
    : But how would you do it with a checkbox as it does not have a selected
    : index.

    This really isn't a true comparison because I would not use a checkbox as a
    toggle unless it was just one.
    [url]http://kiddanger.com/lab/displayta1.asp[/url]

    However, you could do it with two checkboxes.
    [url]http://kiddanger.com/lab/displayta2.asp[/url]

    But, that is not really a true comparison to the collection routine I wrote
    for the select. A better comparison would be one that I wrote in VBScript
    to be run with WSH. I have converted it to JScript for this exercise.

    This is the VBScript version converted from WSH.
    [url]http://kiddanger.com/lab/exp.asp[/url]

    This is the JScript version.
    [url]http://kiddanger.com/lab/expjs.asp[/url]

    HTH...

    --
    Roland

    This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose.
    -Technet Knowledge Base-
    [url]http://support.microsoft.com/default.aspx?scid=fh;EN-US;kbhowto&sd=TECH&ln=EN-US&FR=0[/url]
    -Technet Script Center-
    [url]http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/default.asp[/url]
    -MSDN Library-
    [url]http://msdn.microsoft.com/library/default.asp[/url]


    Roland Hall Guest

  7. #6

    Default Re: pop up text area after click yes from drop down list

    "Don Grover" wrote:
    : This is exactly what I need , can you post the source for this.
    : Wome of my client forms are getting overly long with all the comment data
    : they have to put in.

    Hi Don...
    The files are .asp extension but there is not any server-side code in them.
    It's all done on the client side. You can just view source to get the code.

    I take that back. exp.asp and expjs.asp both call a file to process the
    form: exp2.asp. I doubt you need this but this is the code for it. It was
    originally written to process the form from the .vbs file.

    <%@ Language=VBScript %>
    <% Option Explicit
    ' called from c:\exp.vbs
    dim oArgs, i
    oArgs = split(Request.QueryString("tasks"),", ")
    for i = 0 to ubound(oArgs)
    Response.Write(oArgs(i) & "<br />" & vbCrLf)
    next
    %>

    : Thanks, where would we be without you guys who give their time to us less
    experienced.

    Thank you. I'm sure everyone here learns from someone, at times, especially
    when code can be written many different ways to get the same result. It
    also helps me to try to help someone else and that is a learning experience
    because I don't always know how something is done but rather that I want to
    try to offer a solution. This requires research and I gain knowledge so I
    also get a benefit, not to mention it is a way to give to your profession.
    Now if I could just find a job... (O:=

    Roland


    Roland Hall Guest

  8. #7

    Default Re: pop up text area after click yes from drop down list


    First of all ... in case your new ... the people that read this .db
    group most all read the .general group as well. There is no reason to
    multipost your question.

    I have answered your question in the .general group ... it sounds like
    a client-side Javascript solution you are looking for ... I have
    created a sample page of what I think you are trying to do ... look at
    the code with View Source.

    [url]http://www.coolpier.com/cp/_dev/textareaOnSelect.asp[/url]

    let me know if this is what you were looking for :)

    Brynn
    [url]www.coolpier.com[/url]


    On 6 Jan 2004 14:28:52 -0800, [email]Wei.Huang@slps.org[/email] (weiwei) wrote:
    >Hi all
    >I want to write a asp script, basically, that has drop down box in the
    >form, if user select Yes,
    >on the same page, a hidden textarea will show up, if user select No,
    >then nothing happen.
    >so far, my code is unsuccessful, in addition, I also got syntax error
    >on the response.write line
    >anyone has idea, please help me out, I would really appreciate your
    >help
    >
    >below is my current code
    >
    >
    ><form name="form1" method="post" action="test13.asp">
    >
    ><select name="test">
    ><option value=""></option>
    ><option value="Yes">Yes</option>
    ><option value="No">No</option>
    ></select>
    >
    ><%strtest = request("test")%>
    ><%
    >If strtest = "Yes" Then
    >response.write "<textarea name="whatis" cols="50"></textarea>"
    >Else
    >
    >End if
    >%>
    >
    ></form>
    Brynn Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139