Wrox Programmer Forums
|
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
 
Old July 27th, 2004, 02:18 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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>

 
Old July 27th, 2004, 02:24 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

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
 
Old July 27th, 2004, 02:59 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 
Old July 27th, 2004, 03:29 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

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
 
Old July 28th, 2004, 09:28 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
Default

 <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

 
Old July 28th, 2004, 11:11 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
 
Old July 28th, 2004, 04:04 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Did my suggestion help? What is the difficulty you actually face with that?

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove orphaned html elements from html string pauliehaha C# 2008 aka C# 3.0 2 June 30th, 2008 09:40 AM
html:errors and html:messages sparun1607 Struts 0 November 23rd, 2006 08:34 AM
Converting an HTML Server Control to HTML Control gratisaccount ASP.NET 1.0 and 1.1 Basics 2 August 7th, 2006 12:29 AM
Can you preload child html files to 1parent html? bekim Javascript How-To 4 January 22nd, 2005 04:17 PM
html Moharo HTML Code Clinic 3 August 16th, 2003 12:10 PM





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