 |
| Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases 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
|
|
|
|

July 27th, 2004, 02:18 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Html
When the user clicks on hyper link the asp page goes to the
next page. In the next page I am using the list box option the default of which is blank, when the user cliks on hyperlink of the firstpage,if the title is not null in the data base, it should give the partcular field value in the list box, if the title is null, it should give blank. i am trying to use this code
<h3>Title <SELECT NAME = ASPOpinion></h3>
<OPTION VALUE ="strTitle">
<OPTION VALUE ="strTitle">Sales Representative Vice President, Sales>
<OPTION VALUE ="strTitle"> Vice President, SalesSales Manager
<OPTION VALUE ="strTitle"> Sales Manager
<OPTION VAlUE ="strTitle"> Inside Sales Cordinator
</SELECT>
|
|

July 27th, 2004, 02:24 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
You can write a javascript function that sets up the default value in the list box based on the strTitle value, and call that in body onload event, somthing like
<Body Onload="Javascript:SetTitle();">
Which I feel is easier. You can also do that in ASP. If you are interested in that let me post that too here.
Cheers!
_________________________
- Vijay G
Strive for Perfection
|
|

July 27th, 2004, 02:59 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Give me little bit more idea. I would like to write an
asp code about the list box. Kindly modify the code and explain
the process
|
|

July 27th, 2004, 03:29 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
It should look like this.
Code:
<h3>Title <SELECT NAME = ASPOpinion></h3>
<OPTION VALUE ="---">------</option>
<OPTION VALUE ="Sales Representative Vice President, Sales" <%if strTitle="Sales Representative Vice President, Sales" then %> SELECTED <%End If%>>Sales Representative Vice President, Sales</option>
<OPTION VALUE ="Vice President, SalesSales Manager" <%if strTitle="Vice President, SalesSales Manager" then %> SELECTED <%End If%>>Vice President, SalesSales Manager</option>
<OPTION VALUE ="Sales Manager" <%if strTitle="Sales Manager" then %> SELECTED <%End If%>>Sales Manager</option>
<OPTION VALUE ="Inside Sales Cordinator" <%if strTitle="Inside Sales Cordinator" then %> SELECTED <%End If%>>Inside Sales Cordinator</option>
</SELECT>
Cheers!
_________________________
- Vijay G
Strive for Perfection
|
|

July 28th, 2004, 09:28 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
<h3>Title <SELECT Name=OPinionASp></h3><br>
<OPTION Name ='<%=strTitle%>'> </OPTION>
<OPTION Name="" >Sales Representative </OPTION>
<OPTION Name="">Vice President Sales </OPTION>
<OPTION Name ="">Sales Manager </OPTION>
<OPTION Name ="">Sales Cordinator </OPTION>
</SELECT>
can somebody modify my code as I am not able to get the output
|
|

July 28th, 2004, 11:11 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
What exactly are you trying to do?
I think the example that happygv gave should work. Dd you try it out?Did it work?
There is no name attribute for the <option> element you should use value as in happygv's example....
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

July 28th, 2004, 04:04 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Did my suggestion help? What is the difficulty you actually face with that?
_________________________
- Vijay G
Strive for Perfection
|
|
 |