Wrox Programmer Forums
| 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 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
  #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.
  #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
  #3 (permalink)  
Old August 30th, 2005, 06:46 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 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
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
  #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.


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





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