ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 22nd, 2003, 01:38 PM
atferraz atferraz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 108 atferraz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 4 sec
Reputation Power: 6
select option <- Data problem

select option <- Data problem

Hello,
Have this problem in getting the right option from drop box to show when I edit a DB row in my form.
Firs I get the options fields (2) from a table to a array. Then I ask de number of de row to search for on the DB and show it on the form.
In the middle of that process, I fill the select options from the array and on each iteration I test if that option match the correspondent DB option field. If it does, that option get the "selected" attribute witch should define it to show. But it doesn't


SQLstm="Select nfunc FROM xpto"
rs.Open SQLstm,Lig,1,2
Dim i, arrXpto(3)

rs.MoveFirst
for i=0 to 2 ' get codes from xpto
arrXpto(i)= rs("nfunc")
rs.MoveNext
Next
rs.close

SQLstm="Select * FROM users where nuser="&userNumber 'get specific row from users where the cod is inserted by user
rs.Open SQLstm,Lig,1,2
.....
Response.Write"<select Class='form' name='funcao' style='position:relative; left:0px;'>" ' drop box
for i=0 to 2 'put the array fields on de options
Response.Write "<option class='form' value='" &arrXpto(i,0)
if cInt(arrXpto(i,0)) = cInt(rs("nfuncao")) then ' if the code option match with the row option field then is selected
Response.Write"selected"
end if
Response.write "</option>"
Next
Response.Write"</select>"
__________________
atferraz

Reply With Quote
  #2  
Old October 22nd, 2003, 08:54 PM
atferraz atferraz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 108 atferraz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 4 sec
Reputation Power: 6
problem solved

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > select option <- Data problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT