Ask a Question related to ASP Database, Design and Development.
-
weiwei #1
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
-
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... -
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. -
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... -
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... -
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... -
Roland Hall #2
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
-
Don Grover #3
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...just> "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?test=szValue> 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[url]http://support.microsoft.com/default.aspx?scid=fh;EN-US;kbhowto&sd=TECH&ln=EN-US&FR=0[/url]>
> : <%
> : 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://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/default.asp[/url]> -Technet Script Center-
>> -MSDN Library-
> [url]http://msdn.microsoft.com/library/default.asp[/url]
>
>
Don Grover Guest
-
Don Grover #4
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
-
Roland Hall #5
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
-
Roland Hall #6
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
-
Brynn #7
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



Reply With Quote

