Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old August 29th, 2005, 09:16 PM
Registered User
Points: 1,897, Level: 17
Points: 1,897, Level: 17 Points: 1,897, Level: 17 Points: 1,897, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Mumbai, Maharastra, India.
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default Setting default value in drop down.

Hi,
will this code work?
--------
<select name="M1" value=<%ObjRS(1)%>>
<option value="0">00</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="45">45</option>
</select>
---------
Since i am getting error as item not found or invalid prop assign.

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
__________________
Rupen Anjaria.[:)]
------------------
It is not difficult to be on TOP...It is difficult when you carry Truth,Commitment and Transparency with you.
Reply With Quote
  #2 (permalink)  
Old August 30th, 2005, 12:29 PM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

I don't think this will work
<select name="M1" value=<%ObjRS(1)%>>

If you want to show the value selected from the database then you can add a condition.

Om Prakash
Reply With Quote
  #3 (permalink)  
Old August 30th, 2005, 06:46 PM
Friend of Wrox
Points: 6,468, Level: 34
Points: 6,468, Level: 34 Points: 6,468, Level: 34 Points: 6,468, Level: 34
Activity: 9%
Activity: 9% Activity: 9% Activity: 9%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,835
Thanks: 12
Thanked 16 Times in 16 Posts
Send a message via AIM to mat41
Default

No it wont. If you could co what you are tying to you would:

<select name="M1" value="<%=ObjRS(1)%>">

You need to set an option tag (not the select tag) to "selected" to make a value selected.

<option value="0" <% IF ObjRS(1) = 0 THEN response.write " selected " end if %>>




Wind is your friend
Matt
Reply With Quote
The Following User Says Thank You to mat41 For This Useful Post:
lolz0rable (July 3rd, 2014)
  #4 (permalink)  
Old October 28th, 2009, 04:42 AM
Registered User
 
Join Date: Oct 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to Set the default value of a drop down list.

Hai...

Here is the solution....

http://muruganad.com/ASP.NET/ASP-.NE...ult-Value.html


Thanks!

Murugan Andezuthu Dharmaratnam

http://muruganad.com
Reply With Quote
  #5 (permalink)  
Old July 3rd, 2014, 02:00 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2014
Posts: 1
Thanks: 1
Thanked 0 Times in 0 Posts
Thumbs up

Quote:
Originally Posted by mat41 View Post
No it wont. If you could co what you are tying to you would:

<select name="M1" value="<%=ObjRS(1)%>">

You need to set an option tag (not the select tag) to "selected" to make a value selected.

<option value="0" <% IF ObjRS(1) = 0 THEN response.write " selected " end if %>>




Wind is your friend
Matt
Your solution works like charm. Thx mate.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
no default value for drop down nasirmunir HTML Code Clinic 3 June 10th, 2008 01:13 PM
drop down default value MunishBhatia ASP.NET 2.0 Professional 4 September 5th, 2007 10:31 AM
setting default values prithvi28 XSLT 1 October 3rd, 2006 01:38 PM
Setting default for select (drop-down) box Dave Brown Beginning PHP 1 August 10th, 2005 02:16 PM
setting default month jtyson ASP.NET 1.0 and 1.1 Basics 1 June 30th, 2003 12:44 PM



All times are GMT -4. The time now is 09:07 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.