473,408 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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>
Jul 19 '05 #1
3 6235
ASP is server side technology. What you want is client-side script, like
javascript or client-side vb script. The best way to handle it is to put
the textbox inside a hidden <div> tag, then in the OnChange event for the
select box, check for the value you want and un-hide the div. Like so:

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

<select name="test" onChange="if (document.form1.test.options[1].selected)
{document.hiddenDiv.style.display=''} else
{document.hiddenDiv.style.display='none'} ">
<option value=""></option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>

<div style="display: none" name="hiddenDiv">
<textarea name="whatis" cols="50"></textarea>
</div>

You might want to address any further questions like this to a client-size
scripting group.
"weiwei" <We*******@slps.org> wrote in message
news:d3**************************@posting.google.c om...
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>

Jul 19 '05 #2
thank you very much
"William Morris" <ne***************************@seamlyne.com> wrote in message news:<bt************@ID-205671.news.uni-berlin.de>...
ASP is server side technology. What you want is client-side script, like
javascript or client-side vb script. The best way to handle it is to put
the textbox inside a hidden <div> tag, then in the OnChange event for the
select box, check for the value you want and un-hide the div. Like so:

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

<select name="test" onChange="if (document.form1.test.options[1].selected)
{document.hiddenDiv.style.display=''} else
{document.hiddenDiv.style.display='none'} ">
<option value=""></option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>

<div style="display: none" name="hiddenDiv">
<textarea name="whatis" cols="50"></textarea>
</div>

You might want to address any further questions like this to a client-size
scripting group.
"weiwei" <We*******@slps.org> wrote in message
news:d3**************************@posting.google.c om...
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>

Jul 19 '05 #3
This really is a Javascript question ... but I am going to help you
out anyway and give you the Javascript answer.

go to ...

http://www.coolpier.com/cp/_dev/textareaOnSelect.asp

and view source to see the code

let me know if this helps :)

Brynn
www.coolpier.com
On 6 Jan 2004 14:28:01 -0800, We*******@slps.org (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>


Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Matthew Louden | last post by:
if the user select the EmployeeID in drop down list, and then click the submit button, and it will look up database and show the Employee Name in the text box, this is easy. But my case is:...
2
by: ehm | last post by:
I am working on creating an editable grid (for use in adding, deleting, and editing rows back to an Oracle database). I have a JSP that posts back to a servlet, which in turns posts to a WebLogic...
4
by: Dan | last post by:
Can anyone offer suggestions on how to do this or if it is possible? I have a form that uses a drop down box and 2 text fields. What I am trying to do is have the value of each text box set by...
2
by: Danny Wang | last post by:
HI, I have a dialog (window) with a drop-down list and an OK button. When user clicks the drop-down list, the app need to do some calculation and validation, so I put an Text_on_change event on...
3
by: Don Wash | last post by:
Hi There! I have a Server-side Drop-down box in ASP.NET (VB) page. What do I do to widen the Drop down box's Pull-Down list's width? I'm not talking about the Drop-down box's width but the box...
3
by: excel_hari | last post by:
Hi, I couldnt locate a Classic ASP group hence posting here. One of my colleagues has designed an intranet site and one of the pages has a drop-down box with close to 300 options. I want to...
10
by: lorirobn | last post by:
Hi, I have a form with several combo boxes, continuous form format, with record source a query off an Item Table. The fields are Category, Subcategory, and Color. I am displaying descriptions,...
3
by: jcassan | last post by:
Hello folks. I am new to these forums and have something, which has been stumping me for little while. I am using pspell to spellcheck a scrolling textbox (textarea) containing user input. I...
1
by: bytenut | last post by:
I would like to display two field values in a combo after selecting from the list items... i.e. my drop-down shows two fields from a lookup, but when I select the item, only the first field value is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.