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>
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='block';
} 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>
http://kiddanger.com/lab/displayta.asp
--
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-
http://support.microsoft.com/default.aspx?scid=fh;EN-US;kbhowto&sd=TECH&ln=EN-US&FR=0
-Technet Script Center-
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/default.asp
-MSDN Library-
http://msdn.microsoft.com/library/default.asp
Many Regards
Don
"Roland Hall" <nobody@nowhere> wrote in message
news:%235mZHiK...@TK2MSFTNGP09.phx.gbl...
This really isn't a true comparison because I would not use a checkbox as a
toggle unless it was just one.
http://kiddanger.com/lab/displayta1.asp
However, you could do it with two checkboxes.
http://kiddanger.com/lab/displayta2.asp
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.
http://kiddanger.com/lab/exp.asp
This is the JScript version.
http://kiddanger.com/lab/expjs.asp
HTH...
Thanks, where would we be without you guys who give their time to us less
experienced.
Many Thanks
Don
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
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.
http://www.coolpier.com/cp/_dev/textareaOnSelect.asp
let me know if this is what you were looking for :)
Brynn
www.coolpier.com