Wrox Programmer Forums
|
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 18th, 2003, 02:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default downdown problem in asp

Hi,

How can enter value to retrieve value from the dropdown menu
I want to enter the value and retrieve records as well as
use select option dropdown menu for retrieve the records.
what changes in following select option, please help.

<html>
<body>
contractno<SELECT id="Select1" name="Select1">
       <OPTION selected type=text></OPTION>
       <OPTION selected>75</OPTION>
       <OPTION selected>69</OPTION>
       <OPTION selected>85</OPTION>
       </SELECT>
</body>
</html>


mateen
[email protected]
 
Old July 20th, 2003, 06:27 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Add another option tag.

regards
David Cameron
 
Old July 20th, 2003, 11:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I add another option tag but it not accept input text value,
blank row display.
I want to insert input value in select option also.
 
Old July 20th, 2003, 11:17 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It is unclear what you are asking.

Do you want to a user to be able to add new values into an option list? Do you (ie server side) want to add in new values?

regards
David Cameron
 
Old July 20th, 2003, 11:35 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

no

I make this select option for the searching the records.
I want to search the records by select option and as well as
input the value and get the records.
I could not do so.

How I can careate dropdown list inwhich I select the value and
get records and input the value and get the records.

regards.




Quote:
quote:Originally posted by David Cameron
 It is unclear what you are asking.

Do you want to a user to be able to add new values into an option list? Do you (ie server side) want to add in new values?

regards
David Cameron
 
Old July 20th, 2003, 11:37 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The select tag provides for a read only list. You cannot type in another option.

regards
David Cameron
 
Old July 20th, 2003, 11:42 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

in select option we can input the value and can get the records also.
programmer do so.
but I could not do so.
only one code will add in the above example
select tag will also accept the input value.






Quote:
quote:Originally posted by David Cameron
 The select tag provides for a read only list. You cannot type in another option.

regards
David Cameron
 
Old July 20th, 2003, 11:47 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am having serious problems understanding what you mean. At the moment there are two options:

1. You want to add a new value in the select list from server side.
2. You want someone viewing the page to be able to add in a new value.

1 is simple. You are generating HTML, so generate your select list how you want it to look.

2 is not possible. I said as much in the email above. A person viewing the HTML page cannot add in more values by simply typing them in.

Is that clearer?

regards
David Cameron
 
Old July 21st, 2003, 12:04 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

1. no, I not want to add new value in the server side,
   I just only want insert value in the select list (dropdown list)
   and when I run query it display the records.

I create downdown list option for the searching the records.
When I select option it display the records, but I also want that
when I insert value in the select option I also diaplay the records.

please look my form below

  </form>
    <form method=post action=tripimages/recno.asp id=recordno name=recordno>
  <TR bgcolor=LightGoldenrodYellow>
    <TD width="161">Record Drawings No:</TD>
    <TD width="377"><SELECT id=recordno name=recordno><OPTION selected>
  <%
ssql="select distinct recordno from arc order by recordno"

set rs=cn.Execute(ssql)
do while rs.eof=false
Response.Write("<option value='" & rs("recordno") & "'>")
Response.Write(rs("recordno") )
rs.movenext
loop
%>

  </OPTION></SELECT><INPUT style="WIDTH: 48px; HEIGHT: 24px" type=submit size=16 value=search id=submit4 name=submit4>
     </TD></TR>

</form>

above form display the records, but in the above form how I can insert the
value in the select option so that I could display records.
Because my dropdown list very long, I have thousand of records.
it is difficult for me to select the records.

hope that you will find the solution of my problem.
 
Old July 21st, 2003, 02:07 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've answered your question. If you don't want it to be added *server side* then you *can't* do it. Period. Deal with it and move on.

There are also some errors in your code. For one thing you never close your option tags. You need to do this inside your loop.
<snip>
Code:
set rs=cn.Execute(ssql)
do while rs.eof=false
Response.Write("<option value='" & rs("recordno") & "'>")
Response.Write(rs("recordno") )
Response.Write("</option>")
rs.movenext
loop
%>

  </OPTION></SELECT>
</snip>

Remember when you write ASP you are generating HTML. All you need to do is make sure that the HTML is generated correctly. If it doesn't look right, view the source, and work out why your ASP is generating that HTML.

regards
David Cameron





Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom HTTP 404 Problem w/ASP to ASP.NET kwilliams ASP.NET 2.0 Professional 7 November 26th, 2007 04:17 PM
Problem with ASP AMITAMIT Classic ASP Databases 1 March 16th, 2007 11:05 AM
Server to Server XML Problem (ASP.NET to ASP) Enwood XML 7 April 26th, 2006 03:22 AM
asp problem lotuseducation HTML Code Clinic 1 September 12th, 2005 11:28 AM
ch15 adduser.asp problem beginning asp 3 ellie Access 1 December 30th, 2004 01:49 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.